Page 1 of 1

Disposing of All Connections Leaves Database Open

Posted: Fri 24 Apr 2009 16:23
by leeottaway
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

Posted: Mon 27 Apr 2009 11:41
by leeottaway
Amazingly, even when I connect the global connection to an entirely different database, it STILL leaves the other database open so I can't drop it.

Please respond.

Posted: Mon 27 Apr 2009 14:38
by Shalex
Please try using the ClearPool(pgConn) method instead of ClearAllPools(). Does the problem persist?

Posted: Mon 27 Apr 2009 15:09
by leeottaway
Yes, I already tried that. Problem still persists.

Posted: Tue 28 Apr 2009 06:51
by Shalex
We cannot reproduce the problem with the Devart.Data.PostgreSql.PgSqlConnection.ClearPool(pgConn) method using dotConnect for PostgreSQL 4.0.26.0 and PostgreSQL Server 8.3. Please tell us your versions of dotConnect for PostgreSQL and PostgreSQL Server.

What are exact disadvantages of the mode when pooling is set to false that prevents you from using this mode? Please give us an example.