Disposing of All Connections Leaves Database Open

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for PostgreSQL
Post Reply
leeottaway
Posts: 30
Joined: Sat 10 Nov 2007 20:36

Disposing of All Connections Leaves Database Open

Post by 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

Post by 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.

Shalex
Site Admin
Posts: 8248
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Mon 27 Apr 2009 14:38

Please try using the ClearPool(pgConn) method instead of ClearAllPools(). Does the problem persist?

leeottaway
Posts: 30
Joined: Sat 10 Nov 2007 20:36

Post by leeottaway » Mon 27 Apr 2009 15:09

Yes, I already tried that. Problem still persists.

Shalex
Site Admin
Posts: 8248
Joined: Thu 14 Aug 2008 12:44

Post by 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.

Post Reply