Add on: When I call createSession() with the following parameters, i get rid of the exception:
session = connection.createSession (true, Session.AUTO_ACKNOWLEDGE); Both parameters should be ignored, when the method is called in an EJB container and a JTA transaction is active (see Connection.createSession() <https://docs.oracle.com/javaee/7/api/javax/jms/Connection.html#createSession-boolean-int-> . But even when I leave out the /transacted/ parameter the exception is thrown. The following error message remains: 14:46:50,221 ERROR [org.jboss.jca.core.connectionmanager.listener.TxConnectionListener] (default-threads - 45) IJ000315: Pool ConnectionFactory has 1 active handles So I think this could be considered as a bug. Now arises the next problem. I use the session to send response messages via a response queue to the client. After sending the message I have to commit the transaction, so that the message is actually delivered to the client: producer = session.createProducer (responseQueue); producer.setDeliveryMode (DeliveryMode.NON_PERSISTENT); responseMessage = session.createTextMessage (); ... producer.send (responseMessage); userTransaction.commit (); userTransaction.begin (); This is done in a loop to send progress messages to the client. This works for the first message. But when the second message is sent an exception occurs saying the session is closed. Why this?? Does a commit close the session?? In my opinion this is a bug, too. Thomas -- View this message in context: http://activemq.2283324.n4.nabble.com/Exception-in-createSesson-inside-an-EJB-user-transaction-tp4709452p4709457.html Sent from the ActiveMQ - User mailing list archive at Nabble.com.