1 Reply Latest reply on Jan 30, 2014 9:24 PM by jbertram

    Possible to use 1-phase commit with embedded ActiveMQ

    raylite3

      Hello,

       

      I have a session bean that writes to the DB and publishes a JMS message. If I configure an embedded ActiveMQ broker (Embed ActiveMQ in JBoss AS 7) will it use a 1-phase commit ? That is will my DB write and the JMS message be written in the same DB transaction? Is there a way to configure this?

      Thanks!

        • 1. Re: Possible to use 1-phase commit with embedded ActiveMQ
          jbertram

          Assuming that you are using the connection factory from the ActiveMQ JCA RA and your session bean is running in a JTA context then the DB and JMS operation will be performed atomically (i.e. in the same transaction).  However, the commit will not be 1-phase.  It will be 2-phase since you'll be enlisting more than 1 resource into the transaction (i.e. the DB and the JMS broker).