1 Reply Latest reply on Oct 5, 2009 11:51 AM by jglan

    Transaction not committed before pushing message to JMS

      Hi all

      Hope you can help me with this.

      Given the following scenario:

      1. A user hits a webservice.
      2. The Oracle database is populated with info from the ws request.
      3. The database id of the row created in 2) is used to create a message which is pushed to a JMS queue.
      4. A Message Driven Bean receives the message and tries to retrieve the database row given the id.
      5. The returned row from 4) is often null because, at least that it what suspect, the transaction from 1), 2) and 3) is not committed yet.

      How can I make sure that the transaction has been committed before the MDB awakes?

      We are running the app on JBoss AS 4.2.2 on JDK 6 with no customizations.

      Regards

      Uffe Ronne

        • 1. Re: Transaction not committed before pushing message to JMS
          jglan

          Mu guess would be that jmsConnectionFactory is not configured to use the XA enabled one.
          We use java:/JmsXA via Spring to get it from JNDI and since then the message is sent after or with the commit. Without using the XA version of the Cf the message is sent immediately without "waiting" for the commit and your MDB may not "see" the data yet (you may see it if isolation is set to uncommitted read I'd assume)