Bug 52015

Summary: JdbcInterceptor passes wrong argument to getNext().invoke
Product: Tomcat Modules Reporter: hay_dave
Component: jdbc-poolAssignee: Tomcat Developers Mailing List <dev>
Severity: major    
Priority: P2    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   

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.