Disconnection problem

Disconnection problem

Postby szinkopa » Sat 09 Jul 2005 22:33

I have just noticed that when I disconnect from PostgreSQL, its logfile shows this:

127.0.0.1(1369), otto@test, 1456 [2005-07-10 00:23:26] LOG: statement: SELECT * FROM pgsqldirect.Dept

127.0.0.1(1369), otto@test, 1456 [2005-07-10 00:24:25] LOG: unexpected EOF on client connection

127.0.0.1(1369), otto@test, 1456 [2005-07-10 00:24:25] LOG: disconnection: session time: 0:01:16.86 user=otto database=test host=127.0.0.1 port=1369


The first line is my command
Then I clicked disconnect in the DataReader sample. And nothing happened in the logfile.
Then I closed the DataReader sample application, and the 2nd and 3rd lines was added into the logfile.
This is abnormal termination, Connection.Close() method should disconnect, and it should be shown in the logfile like with psql command line tool, that disconnects correctly.
szinkopa
 
Posts: 16
Joined: Mon 27 Jun 2005 21:12

Postby Oleg » Mon 11 Jul 2005 09:17

This takes place due to Connection Pool. You can turn it off by adding pooling = false to your connection string. You can call PgSqlConnection.ClearPool method to close connections that currently in pool.
Oleg
Devart Team
 
Posts: 264
Joined: Thu 28 Oct 2004 13:56

Postby szinkopa » Sun 24 Jul 2005 18:49

Ok, but when I close the application Dispose is called for the connection, isn't it? And then it should close the connection(s) properly. Right?
szinkopa
 
Posts: 16
Joined: Mon 27 Jun 2005 21:12

Postby Yuri » Mon 25 Jul 2005 13:26

In case where PgSqlConnection object is finalized by Garbage Collector the connection is not always closed right. You have to call explicitly PgSqlConnection.Dispose or PgSqlConnection.Close method.
Yuri
 
Posts: 140
Joined: Mon 08 Nov 2004 12:07


Return to dotConnect for PostgreSQL