Hello,
I used 4 Sql Handlers for many years, one for select, the second for update, the third for delete and fourth for insert.
Now I only use one for all operations. I see no difference whether I use one Sql Handle or whether I use 4 Sql Handles.
What is good practice for usage of Sql Handles?
Regards,
Arunas
Theoretical question about Sql Handles
Re: Theoretical question about Sql Handles
Hello Arunas,
this denpends on the application, but I would say, an average application will have 2 - 4 sql handles. You should check if you use x different connetions or 1 connection with x cursors. This is set in sql.ini (enablemultibleconnections). The difference is, if you use different connections, they will block each other if you have an uncommited update. With multible cursors, you can fetch a result in cursor b after cursor a has updated the value without a commit. If you update a value in a fetch loop, you will need at least two cursors, and you should prepare the statment with SqlPrepare before starting to fetch, and use only SqlExecute within the loop (the prepare of an SqlPrepareAndExecute takes aprox. 90% of the time, but high end databases have a statement cache).
Kind regards
Harald
this denpends on the application, but I would say, an average application will have 2 - 4 sql handles. You should check if you use x different connetions or 1 connection with x cursors. This is set in sql.ini (enablemultibleconnections). The difference is, if you use different connections, they will block each other if you have an uncommited update. With multible cursors, you can fetch a result in cursor b after cursor a has updated the value without a commit. If you update a value in a fetch loop, you will need at least two cursors, and you should prepare the statment with SqlPrepare before starting to fetch, and use only SqlExecute within the loop (the prepare of an SqlPrepareAndExecute takes aprox. 90% of the time, but high end databases have a statement cache).
Kind regards
Harald
Re: Theoretical question about Sql Handles
At least Oracle has only one Channel per Databasename in TNSNames regardless how many Handles you have. So it makes no difference if you're using one or many Handles. If you want to have independent, non blocking Handles you have to work with different DB-Names.
Greez
Andreas
Greez
Andreas
Re: Theoretical question about Sql Handles
Thanks Harald and Andreas
Arunas
Arunas
Who is online
Users browsing this forum: [Ccbot] and 1 guest