Hi,

> 1. Is it correct that the stack trace of the error message shows the
> stack trace of the time when the unclosed connection was opened?

Yes, but for a pooled connection that might be the wrong place.

> 2. When and how does H2 detect that a connection from a connection
> pool is not closed?

Older versions of H2 used a finalize method, but newer versions use a
PhantomReference because that's faster. See also the source code
(org.h2.util.CloseWatcher).

> 3. Sometimes my application closes and reopens the database. Do I have
> to call the dispose method of the old JDBCConnectionPool?

Yes.

> I haven't done that because it's not part of the DataSource interface.

I see. To me this looks like an omission in the API. There are at
least two other connection pools that support 'dispose':

http://cayenne.apache.org/doc12/api/cayenne/org/objectstyle/cayenne/conn/PoolManager.html#dispose()

others use 'close':

http://commons.apache.org/dbcp/apidocs/org/apache/commons/dbcp/datasources/SharedPoolDataSource.html#close()

Regards,
Thomas

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/h2-database?hl=en.

Reply via email to