Bug 52015 - JdbcInterceptor passes wrong argument to getNext().invoke
JdbcInterceptor passes wrong argument to getNext().invoke
Product: Tomcat Modules
Classification: Unclassified
Component: jdbc-pool
PC Linux
: P2 major (vote)
: ---
Assigned To: Tomcat Developers Mailing List
Depends on:
  Show dependency tree
Reported: 2011-10-12 18:09 UTC by hay_dave
Modified: 2011-10-20 09:34 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description hay_dave 2011-10-12 18:09:24 UTC
The default implementation of JdbcInterceptor.invoke passes itself as the proxy argument to the next interceptor in the chain.  I'm thinking this should really pass the 'proxy' argument.

This means that interceptors cannot cast the 'proxy' argument to a java.sql.Connection.

JdbcInterceptor line 94 should look like this:

if (getNext()!=null) return getNext().invoke(proxy,method,args);

instead of this:

if (getNext()!=null) return getNext().invoke(this,method,args);
Comment 1 Keiichi Fujino 2011-10-20 09:34:13 UTC
Thanks for report.
This is  fixed in r1186681 and  will be in 7.0.23 onwards.