I have the MDB with CMT. If I obtain the native connections, I am getting the JBoss message:
09:59:18,505 INFO [CachedConnectionManager] Closing a connection for you. Please close them yourself: org.jboss.resource.adapter.jdbc.WrappedConnection@1ddd026
java.lang.Exception: STACKTRACE
at org.jboss.resource.connectionmanager.CachedConnectionManager.registerConnection(CachedConnectionManager.java:321) etc....
The problem was isolated to the following few lines:
public void onMessage(Message message)
{
try {
InitialContext initialContext = new InitialContext();
DataSource dataSource = (DataSource) initialContext.lookup(ITM_DATA_SOURCE_REF);
Connection wrappedConnection = (WrappedConnection) dataSource.getConnection();
Connection connection = ((WrappedConnection) dataSource.getConnection()).getUnderlyingConnection();
wrappedConnection.close();
}
catch (Exception e)
{
log.error("ERROR", e);
throw new EJBException (e);
}
}
The mere fact of getting the native connection generates the message
I also can not close the native connection as it throws off the transaction manager.
Please help!!!