4 Replies Latest reply on Mar 31, 2004 10:35 AM by rmessa

    jms and sap jca

    rmessa

      I want to make an MDB as follows:

      1- A jms message starts the MDB
      2- One or more update are performed in SAP (using JCA)
      3- One or more jms messages are sent

      I want all of this to be atomic: XA (all or nothing)

      I've been reading in many places that SAP JCA only supports local transactions, so my conclusion is that I cannot have this cenario due to this restriction of SAP.

      I am wrong?
      Does anybody knows how can I workaround this?

        • 1. Re: jms and sap jca
          nort

          you are right; sap doesn't support XA. But you can realize "virtual transactions" by your own TransactionManager if you want. Is a lot of work to do that...

          Juraj

          • 2. Re: jms and sap jca
            rmessa

            What is a "virtual transaction"?

            By the way, there are some products like WebMethods and Tibco saying their products perform transactions in SAP and also send their proprietary messages.

            If SAP does support only local transactions and, according to the book J2EE Connector Architecture and Enterprise Application Integration by Sharma, Stearns and Ng not all SAP RFC support local transactions (some of them always commit). How can these products perform transaction involving their messages and multiple RFC call?

            Ok, they must have implemented some kind of transaction manager of their own, but it still have the SAP restrictions and this whole thing does not seem to work.

            It is more or less the same thing on IBM and BEA integration products based on J2EE. Up to what I could understand, they also say you can send JMS messages and perform JCA SAP RFC calls inside a MDB, example. If SAP does not support global transactions, how can they assure all messages and function calls will be performed in a atomic way?

            Can anybody throw the light over me on the real functionality of those products?

            • 3. Re: jms and sap jca

              Are you talking about the last resource gambit?

              prepare XA aware
              commit single local resource
              if (fails)
              rollback XA resources
              else
              commit XA resources

              I've implemented that in jboss4 (see the DR3 download)
              It will get backported to jboss-3.2 when I have time to retest it.

              Regards,
              Adrian

              • 4. Re: jms and sap jca
                rmessa

                Yeah! The last resource optimization would solve the problem as long as you use only RFCs that do not auto commit (not all RFCs can participate in a local transaction with many updates - up to I could research).

                Will JBoss be prepared for last resource optimization in the next two months?

                I mean, realiable enough to be presented to a customer as a solution for the following problem?

                1-MDB triggered by a JMS message
                2-MDB performs one or more updates in SAP
                3-MDB sends one or more JMS messages

                All of that in an atomic operation or all rolledback.

                Thanks