The proxy connection returned by the jdbc-pool is not proxying the resultSet and the statement so if the client gets access to the underlying connection through: resultSet.getStatement().getConnection() He is able to close the physical connection due to both instances (resultSet and statement) were not proxied. If this happens next time a client gets a connection from the jdbc-pool it will return a proxy with a physical connection closed.
jdbc-pool version is: 1.0.7.1
Created attachment 24713 [details] JdbcInterceptor to proxy resultSets and statements Implemented a JdbcInterceptor to proxy resultSets and statements.
For reference: link to the discussion thread on users@: http://markmail.org/thread/lf4l3tjy5eev5kxo http://marc.info/?t=126089853000004&r=1&w=2
The patch contains a package name we can't use, and it doesn't have any license header in it. Can you adjust the package name to org.apache.tomcat.jdbc.pool.interceptor and add the license header (just look at an existing source file)
Created attachment 25054 [details] Statement decorator interceptor that proxies the resultSet and statement. Corrected the package and added the license header as suggested by Filip.
Thank you for the patch. It's been committed with a change to org.apache.juli.Log instead of Log4j
Created attachment 27457 [details] A correction to the createDecorator() method in the interceptor There appears to be a typing error in the createDecorator() method of the interceptor, setting the connection to the constructor object: statementProxy.setConnection(proxy); statementProxy.setConstructor(constructor);
Thank you Fixed in r1169796
Hi, I'm using ddlutils 1.0 and tomcat jdbc pool 1.0.7.1 and I getting an error due to a connection is closed and the pool is not aware of that. Basically the issue is that ddlutils has a resultset iterator and when it finishes it closes the connection by getting it from the * resultSet.preparedStatement.connection* and the connection returned is not the proxy that the pool has created. So the issue happens when another client retrieves a connection from the pool because the pool returns a connection that was actually closed. Why tomcat jdbc pool is not creating proxies for preparedStatements and resultSets like commons-dbcp? Is there any other way to address this issue? Thanks Antonio - https://kmidata.es/
*** Bug 65932 has been marked as a duplicate of this bug. ***