Re: DB Pool Connections not closing, getting broken connections

From: Scott Ferguson <ferg@xxx.com>
Date: Wed Nov 12 2003 - 09:36:12 PST

Justin Van Vorst wrote:

> I've just started moving an application from Tomcat to Resin 3.0.4,
> and I'm having a nightmare dealing with the DB pool (connecting to
> MySql 3.23).
>
> Currently all of my database operations are encapsuated in a single
> utility class (e.g. public ResultSet executeQuery(String sql) ,
> public void closeQuery(ResultSet rs) ) which has served me well in the
> past. For whatever reason, with Resin when I close a connection (and
> I am calling close() ) it doesn't seem to take effect because I see
> "Closing dangling connection" messages.

I'm adding some logging to help track this down. Are you using
transactions or just plain connections.

The code you sent isn't particularly important. The important pattern is:

Connection conn = dbUtil.fetchConnection();
try {
  ...
} finally {
  dbUtil.releaseConnection(conn);
}

-- Scott
Received on Wed 12 Nov 2003 09:36:12 -0800

This archive was generated by hypermail 2.1.8 : Thu Sep 28 2006 - 20:18:05 PDT