Disposing of All Connections Leaves Database Open
Posted: Fri 24 Apr 2009 16:23
Hi
I have a question that is closely linked to hmuscrofts point. I hold a global connection to the database in my windows application and mainly because of all the network issues that occur with setting pooling to false (see hmuscrofts posts) I have pooling set to true. The disadvantage comes to when I try restoring a database backup using the current database name. I close the global connection, dispose of the connection call ClearAllPools, yet any attempt to rename or drop the current database always results in "Database is currently in use by another user". Setting pooling to false immediately gets around this problem but then I expose myself to all the network issues that others have run into.
Is there any way at all of closing the database connection in an application so you can actually drop or rename the database whilst pooling is set to true?
Thanks
Lee
I have a question that is closely linked to hmuscrofts point. I hold a global connection to the database in my windows application and mainly because of all the network issues that occur with setting pooling to false (see hmuscrofts posts) I have pooling set to true. The disadvantage comes to when I try restoring a database backup using the current database name. I close the global connection, dispose of the connection call ClearAllPools, yet any attempt to rename or drop the current database always results in "Database is currently in use by another user". Setting pooling to false immediately gets around this problem but then I expose myself to all the network issues that others have run into.
Is there any way at all of closing the database connection in an application so you can actually drop or rename the database whilst pooling is set to true?
Thanks
Lee