4 Replies Latest reply: May 7, 2012 10:22 AM by User10644357-Oracle RSS

    OSB 10.3 - JMS Proxy Service, http Biz Service - Transaction Rollback

    User10644357-Oracle
      Hello,

      I am working with OSB 10.3

      I need to develop a proxy service that reads from a JMS queue using an Xa connection factory, then calls an http business service and rolls back the tx (i.e. puts the message back in the queue) in case of any error (included http 500 and 404 return codes).

      Thanks for any hint
      Regards
      F.C.
        • 1. Re: OSB 10.3 - JMS Proxy Service, http Biz Service - Transaction Rollback
          AbhishekJ
          You can find a good description on handling transactions within OSB on a blog written by one of the forum members here:
          http://atheek.wordpress.com/2011/04/21/transaction-handling-within-osb/

          Here is a summary as well:
          1. When you want transaction to roll back: Let the error reach system error handler - You can achieve this by either an explicit Raise Error to bubble up the error or by NOT using Reply or Resume action in error handler
          2. When you want transaction to commit (so message will be deleted from the source queue in case of JMS) - Make sure you use Reply action in the error handler (Reply with Failure or Success does not matter, as soon as you use Reply action it means that you have handled the error and transaction will commit).

          Apart from this you have to make sure of following:
          1. Connection factory being used is XA enabled
          2. Is XA Required checkmark is enabled in Proxy JMS configuration page
          3. Transaction Required checkmark is enabled in Proxy Message Handling page [Dont remember if this option was available in 10gR3 but if it isnt then step 5 will cover it]
          4. Same transaction for response thread is enabled in Proxy Message Handling page if you want to rollback for any errors in Response pipeline (for example by validating or checking some condition in the response of target service you want to rollback by raising error) [Dont remember if this option was available in 10gR3 but if it isnt then step 5 will cover it]
          5. Use QoS as exactly-once in Routing options in Publish or Route action or use Service Callout
          • 2. Re: OSB 10.3 - JMS Proxy Service, http Biz Service - Transaction Rollback
            User10644357-Oracle
            Hello,

            the blog solves the problem for OSB 11g.

            However we are on 10.3, we have a (non trapped) System Exception in response pipeline when our call to http biz service gives 500 or 404 return code.
            Still the transaction gets committed.

            We probably miss some configuration
            The "Same transaction for response " flag does not exist in 10.3.

            (And we cannot use "Exctactly Once" on our http biz service, can we?)

            F.C.
            • 3. Re: OSB 10.3 - JMS Proxy Service, http Biz Service - Transaction Rollback
              687626
              We solved this in an old version of osb (alsb 2.6) by setting some java arguments.. don't remember the argument as it was done quite a while back.. may be the same might be applicable with osb 10.3 ..better check with the support.
              • 4. Re: OSB 10.3 - JMS Proxy Service, http Biz Service - Transaction Rollback
                User10644357-Oracle
                We solved it switching from route node to service callout