tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Romain Manni-Bucau <rmannibu...@gmail.com>
Subject Re: Access the underlying connection.
Date Wed, 04 May 2016 06:21:50 GMT
Hi

Depend the config and datasource pool but here the things to check:
- access is allowed in the xml configuration (dbcp has a flag for instance)
- if proxied - can be for logging, jta... - ensure to unwrap it
(Proxy.getInvocationHandler(ds).getDelegate())
Le 4 mai 2016 08:00, "tonywestonuk" <tonyw@totspics.com> a écrit :

I need to get the underlying connection...so I can create Postgresql large
objects.

However, this doesn't work:

Connection rawConn = ((DelegatingConnection<Connection>)
con).getInnermostDelegate();

I get this error:
java.lang.ClassCastException: com.sun.proxy.$Proxy121 cannot be cast to
org.apache.tomcat.dbcp.dbcp2.DelegatingConnection


(I tried also with the other 2 DelegatingConnections in the class path with
the same results).





--
View this message in context:
http://tomee-openejb.979440.n4.nabble.com/Access-the-underlying-connection-tp4678338.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message