JMS QueueSession concept
marcdevinci May 22, 2003 5:35 AMHi,
I just upgraded jboss3.0.6 to jboss3.0.7 and I have now an interessting message in my logs :
INFO CachedConnectionManager - Successfully closed a connection for you. Please close them yourself: org.jboss.resource.adapter.jms.JmsSession@150818a
java.lang.Exception: Stack Trace
at org.jboss.resource.connectionmanager.CachedConnectionManager.closeAllCachedConnectionManager.java:357)
at org.jboss.resource.connectionmanager.CachedConnectionManager.popMetaAwareObjectCachedConnectionManager.java:199)
at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invokeCachedConnectionInterceptor.java:190)
at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:77)
at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:107)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:237)
at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:98)
at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:130)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:208)
at org.jboss.ejb.StatelessSessionContainer.invoke(StatelessSessionContainer.java:313)
at org.jboss.ejb.Container.invoke(Container.java:738)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)
at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:99)
at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:102)
at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:77)
at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:80)
at org.jboss.proxy.ejb.StatelessSessionInterceptor.invoke(StatelessSessionInterceptor.java:111)
at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:76)
...
To summarize the situation I have a servlet which call an EJB(SLSB) and this EJB sends a JMS message.
In my EJB, I create a JMS queue connection then a JMS queue session then a sender and finally I send the JMS message (until now nothing special).
At the end of the code of my EJB, I have a finally block where I close the JMS queue connection :
...
finally{
if (queueConnection != null) {
try {
queueConnection.close();
}
catch (Exception e) {
cat.error("Cannot close JMS queue connection", e);
}
}
}
If I try to close the queue session before that I close the queue connection, I have no more the interessting message in my logs... But I do not find any information in the J2EE spec about how and when close a JMS queue session!
Can somebody say me what is the true method to close a JMS queue session in a EJB context?
Thanks in advance!