Dear All,
I am having one issue with the tomcat server when casting the tomcat.dbcp connection to Oracle connection.
The code looks like:
Connection conn = ds.getConnection();
OracleConnection underlyingConnection = null;
Connection dconn = (OracleConnection) ((DelegatingConnection) conn).getInnermostDelegate();
Here it will throws the
Classcast exception (org.apache.tomcat.dbcp.dbcp **** to Oracle Connection)
The DelegatingConnection is from Tomcat DBCP jar.
I am using Tomcat 6.0.29 and 6.0.37.
When i googled, i got to know adding the parameter accessToUnderlyingConnection=True in Datasource fixes the problem. And it works as well.
But the site
http://commons.apache.org/proper/commons-dbcp/configuration.html says,
Default is false, it is a potential dangerous operation and misbehaving programs can do harmfull things. (closing the underlying or continue using it when the guarded connection is already closed) Be carefull and only use when you need direct access to driver specific extentions.
NOTE: Do not close the underlying connection, only the original one.
Hence the fix which i proposed got rejected.
Tried with the different Tomcat version - 6.0.20, this Casting is working fine without adding any parameters in the XML files.
Could anyone help to clarify this?
Why it is working in 6.0.20 and not in 6.0.29 version?
And how to fix this issue in 6.0.29 version as well?
Thanks,
Bala N.
Thanks,
Bala N.