Questions about pooling + disconnected mode
Posted: Fri 10 Jun 2011 08:20
I'm thinking about changing some of my code in my multi threaded application to use pooling + disconnected mode, instead of one unique connection in each thread - just to keep number of concurrent connections to a minimal.
First of all, if I configure pooling + disconnected mode, will this be 100% thread safe, and will it mean that the connection actually stays connected within the pool, and that the thread will get/return the connection only during the actual database communication stage?
Secondly, if I really want to do several queries to the database within one thread, and make sure to keep the same connection, is StartTransaction/Commit the only way to keep it like that, or is there another way? I have some SQL queries using some specific locking code etc, and I'm not sure starting a transaction there is the best solution.
Regards,
Peter Olsson
First of all, if I configure pooling + disconnected mode, will this be 100% thread safe, and will it mean that the connection actually stays connected within the pool, and that the thread will get/return the connection only during the actual database communication stage?
Secondly, if I really want to do several queries to the database within one thread, and make sure to keep the same connection, is StartTransaction/Commit the only way to keep it like that, or is there another way? I have some SQL queries using some specific locking code etc, and I'm not sure starting a transaction there is the best solution.
Regards,
Peter Olsson