private Session createSession() throws JMSException {
Session s = physicalConnection.createSession(true, Session.SESSION_TRANSACTED);
if (s instanceof ActiveMQSession) {
ActiveMQSession session = (ActiveMQSession) s;
LocalTransactionEventListener l = createLocalTransactionEventListener();
session.setLocalTransactionEventListener(l);
}
else {
log.trace("Cannot register LocalTransactionEventLister on non-ActiveMQ session");
}