3 Replies Latest reply on Jun 1, 2006 2:32 PM by Mark Little

    Transaction Bridging (JIRA: JBTM-44)

    Paul Robinson Master

      Hello,

      I noticed you have a JIRA issue for implementing "Transaction Bridging" in the WS-TX implementation:
      http://jira.jboss.com/jira/browse/JBTM-44

      By "Transaction Bridging" do you mean bridging traditional J2EE transactions (JTA and JTS) with WS-AtomicTransaction?

      I would like to update an XA compliant database as part of a WS-AtomicTransaction. With the current WS-TX implementation I would begin by putting the "work" (ie running the query on the DB) inside the application web service and I would then put the transactional logic inside a durable2PCParticipant which I would register with the web service transaction. The problem as I see it is that the interface to the XA transaction is closed top (i.e. the client may only initiate the termination protocol, not control it directly). Thus it does not map nicely onto a durable2PCParticipant as there is nothing I can do in the prepare phase to ensure the transaction can later commit or rollback as requested by the coordinator.

      Am i right in thinking that "Transaction Bridging" will address the above problem by allowing me to transparently enlist XA resources within a WS-TX based transaction? Or do I have the wrong end of the stick with respect to "Transaction Bridging". In which case, what is the preferred way to enlist JEE transactional resources, such as databases, entity beans, message queues etc.

      Thanks,

      Paul.

        • 1. Re: Transaction Bridging (JIRA: JBTM-44)
          Mark Little Master

          Hmmm, you mean XAResource doesn't have prepare, commit or rollback operations? I'm sure it did last time I looked.

          Plus, open-top and closed-top are BTP terms.

          • 2. Re: Transaction Bridging (JIRA: JBTM-44)
            Paul Robinson Master

            I think I need to re-phrase my question.

            The main question:

            1) What is "Transactional bridging". I think (and hope) that it allows you to update transactional resources such as entity beans, queues and databases, within a Web service and if that web service is called within a WS-TX transaction, those resources will be transparently enlisted in that transaction.

            The secondary issue:

            2) I originally thought about wrapping an XA resource with a Durable2PCParticipant, to achieve bridging between a WS-TX transaction and an XA resource. However, I don't think you will *always* be able to obtain an XA resource. For example, what about if you where doing work on an entity bean?

            My other thought was that I could undertake the work within the scope of a new UserTransaction. But this interface only allows me to initiate the termination protocol, which would be un-satisfactory. I used the term "Closed top" because the UserTransaction doesn't give you control over each phase of the termination protocol. I didn't realise this was a term only used in BTP.

            I hope this clarifies things,

            Paul.

            • 3. Re: Transaction Bridging (JIRA: JBTM-44)
              Mark Little Master

               

              "n9086822" wrote:
              I think I need to re-phrase my question.

              The main question:

              1) What is "Transactional bridging". I think (and hope) that it allows you to update transactional resources such as entity beans, queues and databases, within a Web service and if that web service is called within a WS-TX transaction, those resources will be transparently enlisted in that transaction.


              Yes. Another term for it is end-to-end transactions.


              The secondary issue:

              2) I originally thought about wrapping an XA resource with a Durable2PCParticipant, to achieve bridging between a WS-TX transaction and an XA resource. However, I don't think you will *always* be able to obtain an XA resource. For example, what about if you where doing work on an entity bean?


              Obviously if *you* can't get a 2PC resource (XAResource is just a particular type of 2PC resource) and wrap it, then you're in trouble. Even end-to-end transactions will only take things so far: as some point you will find applications where you will need to have control over what gets registered with the transaction.


              My other thought was that I could undertake the work within the scope of a new UserTransaction. But this interface only allows me to initiate the termination protocol, which would be un-satisfactory. I used the term "Closed top" because the UserTransaction doesn't give you control over each phase of the termination protocol. I didn't realise this was a term only used in BTP.


              You should not have access over the termination protocol like this. You should read this paper (http://www-128.ibm.com/developerworks/webservices/library/ws-comproto/) to understand why.