Hello all, So we have 2 Linux servers running our application with Tomcat-6.0.35, JDK 1.6.30. We are using: tomcat-jdbc.jar (Verison 1.1.1),
mysql-connector-java-3.1.12-bin.jar We have 'removeAbandoned' flag to true in our configuration. We initially had commons-dbcp.jar 1.3 version and as it gave problems, we started using tomcat-jdbc.jar. One of the servers is working normally, but we saw one issue on the second server. it hasn't been releasing the connections and was consistently growing slowly. So i collected thread dump and i saw a deadlock : Found one Java-level deadlock: ============================= "catalina-exec-1": waiting to lock monitor 0x000000005d7944b8 (object 0x00000005bd522568, a com.mysql.jdbc.Connection), which is held by "[Pool-Cleaner]:Tomcat Connection Pool[1-1015483951]" "[Pool-Cleaner]:Tomcat Connection Pool[1-1015483951]": waiting to lock monitor 0x000000005dcdea28 (object 0x00000005bd659ce8, a com.mysql.jdbc.ResultSet), which is held by "catalina-exec-1" Java stack information for the threads listed above: =================================================== "catalina-exec-1": at com.mysql.jdbc.Connection.getCharsetConverter(Connection.java:3177) - waiting to lock <0x00000005bd522568> (a com.mysql.jdbc.Connection) at com.mysql.jdbc.Field.getStringFromBytes(Field.java:583) at com.mysql.jdbc.Field.getName(Field.java:487) at com.mysql.jdbc.ResultSet.buildIndexMapping(ResultSet.java:593) at com.mysql.jdbc.ResultSet.findColumn(ResultSet.java:926) - locked <0x00000005bd659ce8> (a com.mysql.jdbc.ResultSet) at com.mysql.jdbc.ResultSet.getInt(ResultSet.java:2401) "[Pool-Cleaner]:Tomcat Connection Pool[1-1015483951]": at com.mysql.jdbc.ResultSet.close(ResultSet.java:736) - waiting to lock <0x00000005bd659ce8> (a com.mysql.jdbc.ResultSet) at com.mysql.jdbc.Statement.realClose(Statement.java:1606) - locked <0x00000005bd522568> (a com.mysql.jdbc.Connection) - locked <0x00000005bd5e81c0> (a com.mysql.jdbc.ServerPreparedStatement) at com.mysql.jdbc.PreparedStatement.realClose(PreparedStatement.java:1703) at com.mysql.jdbc.ServerPreparedStatement.realClose(ServerPreparedStatement.java:901) - locked <0x00000005bd525ba0> (a java.lang.Object) - locked <0x00000005bd522568> (a com.mysql.jdbc.Connection) - locked <0x00000005bd5e81c0> (a com.mysql.jdbc.ServerPreparedStatement) at com.mysql.jdbc.Connection.closeAllOpenStatements(Connection.java:2126) at com.mysql.jdbc.Connection.realClose(Connection.java:4422) at com.mysql.jdbc.Connection.close(Connection.java:2098) - locked <0x00000005bd522568> (a com.mysql.jdbc.Connection) at org.apache.tomcat.jdbc.pool.PooledConnection.disconnect(PooledConnection.java:320) Please help us on this. Could it be a problem with tomcat-jdbc.jar? What should be our next steps? I have read some article saying tomcat-jdbc.jar would give better performance than commons dbcp pool. Thanks