4 Replies Latest reply on Sep 8, 2006 11:18 AM by Weston M. Price

    StdServerSession/StdServerSessionPool -- JmsServerSession/Jm

    Weston M. Price Master

      I just wanted to verify that the changes I have made in both the ASF implementation, as well as the JCA Inflow adapter are correct and that I understand the implications of both.

      To make things a bit clearer, I created a TransactionDemarcationStrategy interface with the error() and end() methods. Depending upon the context either a LocalDemarcationStrategy or XADemarcationStrategy gets created.

      Where this gets created is dependent upon the USE_OLD flag that is dependent on a system property (org.jboss.jms.asf.useold) which, by default is set to false.

      So, when the run() method of StdServerSession or JmsServerSession gets executed, and based upon that flag, a TransactionDemarcation gets created. The USE_OLD == true flag requires the the Demarcation be created in the call to onMessage versus being created at Session run (ie UOW begins prior to the get of after the get has occured).

      XA scenario:

      In the case where the delivery is transacted (local tx false) XADemarcation gets constructed and a transaction is begun and the underlying XAResource gets enlisted. An errors thrown are handled in the demarcation error() method and as a result, the transaction is marked for rollback. The end() method then either commits or rollbacks depending upon completion of onMessage.

      Local scencario:

      This was the weird one in my mind and was largely prompted by the RuntimeException/BMT discussion. In this scenario local JMS transactions are used to 'dummy up' a transaction in the case of BMT to primarily handle the case where a listener throws a RunTime excpetion and the message should not be acknowledged. If the underlying JMS session is transcated the error() and end() method function like the XA scenario with the difference being that the JMS API is used to manage the transaction context.

      Note the issue filed here:

      http://jira.jboss.com/jira/browse/JBAS-3631

      should be incorporated into this work as well.