Geeting internal Oracle connection from Hibernate in JBoss

Posted by espressoshot on Stack Overflow See other posts from Stack Overflow or by espressoshot
Published on 2010-05-05T21:54:23Z Indexed on 2010/05/05 21:58 UTC
Read the original article Hit count: 215

Hello,

I need to set an application context through Hibernate. I found there is a method setApplicationContext on oracle.jdbc.internal.OracleConnection. I wrote a test, in which I was getting the Oracle connection from the Hibernate session and it worked fine. However, when I moved the code to my application running under JBoss where connections are obtained from the pool the solution won't work. The error is: $Proxy51 cannot be cast to oracle.jdbc.internal.OracleConnection. (1) How can I get the internal connection in that environment? (2) Is there a better way to set an application context through Hibernate (docs don't say anything about it).

Thanks so much.

Kris

© Stack Overflow or respective owner

Related posts about hibernate

Related posts about Oracle