Announcement Announcement Module
Collapse
No announcement yet.
WebSphere + JMS + XA Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • WebSphere + JMS + XA

    I'm using WebSphere AS 5.1 + DB2 with Hibernate + JMS (WSAD MQ Simulator implementation). I've configured a JtaTtransactionManager and
    the JMS-Queues and ConnectionFactories are managed by the server.
    There is a problem with the following method which is called within a global transaction:

    Code:
    public void deliverMail(final MailVO mailVO) {
      jt = new JmsTemplate102(connectionFactory, false);
      jt.send(queue, new MessageCreator() {
        public Message createMessage(Session session) throws JMSException {
          ObjectMessage message = session.createObjectMessage(mailVO);
          return message;
        }
      });
    }
    The method send() throws an IllegalStateException: Method not permitted in global transaction. This is because in doSend() the session is committed which is of course not allowed:

    Code:
    if (session.getTransacted() && !TransactionSynchronizationManager.hasResource(getConnectionFactory())) {
      // transacted session created by this template -> commit
      session.commit();
    }
    The problem is the second condition, there is no connectionfactory in the transactionmanager-map. Why not?
Working...
X