The problem is likely due because the connection served by the pool is not the *real* connection but a proxy to it.
Drop 3P0 and use Proxool instead. In its current version, Proxool gives you access to the *real* connection so you can cast it to the Oracle one and get access to any vendor extensions.
Code:
Connection c = session.getConnection();
OracleConnection realConnection = (OracleConnection)ProxoolFacade.getDelegateConnection(c);
.. then do something on the OracleConnection
In its upcoming release, things will even be easier since the proxied connection returned by proxool will implement not only the java.sql.Connection interface but *all* interfaces implemented by the *real* connection.
Therefore, if the OracleConnection is actually an interface, your code could become:
Code:
OracleConnection c = (OracleConnection) session.getConnection();
... then do something with the OracleConnection
Cool, isnt'it ?