[gnome-db] 2 issues with GdaConnection

On page:
for function gda_connection_open_from_dsn, we find:
" If a new GdaConnection <http://library.gnome.org/devel/libgda-4.0/3.99/GdaConnection.html> is created, then the caller will hold a reference on it." This seems to imply that if an existing connection was returned from a pool of connections, then the caller does not hold a reference on it. Therefore, the caller should call g_object_unref only in the case when a new connection is created.
Question: How does one tell if a new connection was created?

On page:
We find this statement:
" Closing the connection can be ordered using gda_connection_close () <http://library.gnome.org/devel/libgda-4.0/3.99/GdaConnection.html#gda-connection-close>, or is automatically done when the connection object is destroyed (as is the case in the example abive when g_object_unref() is called with the connection as argument)."

When I called g_object_unref on the connection, expecting it to close automatically, I found the following in the PostgreSQL log:
issue513149_dbLOG:  unexpected EOF on client connection
issue513149_dbLOG: disconnection: session time: 0:00:00.268 user=issue513149_user database=issue513149_db host= port=37580

When I added a call to gda_connection_close prior to the g_object_unref, the unexpected EOF message did not appear. It seems that with PostgreSQL, the connection is not automatically closing.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]