2 Replies Latest reply on Dec 7, 2013 6:14 AM by jbride

    policy-transaction quickstart:  message always sent to queueB

    jbride

      Hi.

        I'm going through the demo/policy-transaction quickstart from latest FSW beta.

        The results of various scenarios i've tried all make sense with the exception of when i execute the following:

       

      mvn exec:java -Dexec.args="rollback.B policyQSTransacted"

       

      I do see in the server log the following message:

       

      TaskBService :: Marked transaction to rollback!

       

      My expectation would be that the initial global transaction commits (it does) and that the local transaction specific to TaskBServiceBean would rollback and subsequently a new message would not be enqueued into queueB.

      However, what i'm observing is that a new message is enqueued.

       

      Is my reasoning/expectations regarding this scenario incorrect ?

      What would it take to prevent a message from being enqueued into queueb.

       

      thank you!

      jeff

        • 1. Re: policy-transaction quickstart:  message always sent to queueB
          igarashitm

          Hi Jeff, welcome back to the SwitchYard

           

          Nope, message is sent to the queueB even if the transaction for the TaskBService is rolled back. TaskBServiceBean has a reference to the StoreBService, which send a message to the queueB, has "suspendsTransaction" policy, so the transaction sending JMS message doesn't synchronize with TaskBServiceBean.

           

          I know it's a bit confusing and actually some people have asked exactly same question, but I wanted to demonstrate the managedTransaction.Local policy there

           

          Thanks,

          Tomo

          • 2. Re: policy-transaction quickstart:  message always sent to queueB
            jbride

            ahh, yes.  thanks Tomo!  completely overlooked the SUSPENDS_TRANSACTION on StoreBService.  Makes complete sense why message is enqueued to queueB.

            and, when the trnx policy on StoreBService is switched to PROPOGATE_TRANSACTION, the message is not enqueued on queueB .  perfect.

             

            like always ... thanks Tomo!

             

            jeff