Am Freitag, den 25.01.2008, 16:40 -0500 schrieb tc: > The calls look like this: > > public void testXXX(DataSource ds, String login) { > PreparedStatement ps=null; > ResultSet rs=null; > > try { > ... > }catch (Exception e) { > System.out.println("Exception: " + e); > e.printStackTrace(); > } > finally { > try { ... > try { > if(conn != null || conn.isClosed()) conn.close(); You are closing the connection only, if it is not null and already closed. So it will most likely be left open. You probably wanted
if ( !(conn == null || conn.isClosed()) ) { conn.close() }; // but why should the connection be closed here? If you think you have a datasource connection leak, you can search the docs http://tomcat.apache.org/tomcat-6.0-doc/jndi-datasource-examples-howto.html for "Preventing dB connection pool leak" and setting the logAbandoned, removeAbandoned and removeAbandonedTimeout parameters in your datasource. Bye Felix --------------------------------------------------------------------- To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]