Bug 52015 - JdbcInterceptor passes wrong argument to getNext().invoke
Summary: JdbcInterceptor passes wrong argument to getNext().invoke
Status: RESOLVED FIXED
Alias: None
Product: Tomcat Modules
Classification: Unclassified
Component: jdbc-pool (show other bugs)
Version: unspecified
Hardware: PC Linux
: P2 major (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-12 18:09 UTC by hay_dave
Modified: 2011-10-20 09:34 UTC (History)
0 users



Attachments

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.