Disposing of All Connections Leaves Database Open

Disposing of All Connections Leaves Database Open

Postby leeottaway » 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
leeottaway
 
Posts: 30
Joined: Sat 10 Nov 2007 20:36

Postby leeottaway » Mon 27 Apr 2009 11:41

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.
leeottaway
 
Posts: 30
Joined: Sat 10 Nov 2007 20:36

Postby Shalex » Mon 27 Apr 2009 14:38

Please try using the ClearPool(pgConn) method instead of ClearAllPools(). Does the problem persist?
Shalex
Devart Team
 
Posts: 7773
Joined: Thu 14 Aug 2008 12:44

Postby leeottaway » Mon 27 Apr 2009 15:09

Yes, I already tried that. Problem still persists.
leeottaway
 
Posts: 30
Joined: Sat 10 Nov 2007 20:36

Postby Shalex » Tue 28 Apr 2009 06:51

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.
Shalex
Devart Team
 
Posts: 7773
Joined: Thu 14 Aug 2008 12:44


Return to dotConnect for PostgreSQL