users@glassfish.java.net

Unwrapping the connection from EntityManager

From: Gabriel De Lima Nascimento <gabriel.nascimento_at_gvt.com.br>
Date: Thu, 9 Feb 2012 15:02:07 -0200

Hi,

 

 

I'm trying to get the connection from the connection pool I have
configured in Glassfish to use with OracleAQ. I managed to get the
underlying connection from the EntityManager using
em.unwrap(java.sql.Connection.class), however when I try using this
connection to create the QueueConnection I get a
oracle.jms.AQjmsException: JMS-112: Connection is invalid, even though
the Coonection.isValid() method returns true.

 

So is there something I'm missing here? Is the connection returned by
the unwrap method usable in this situation?