2 Replies Latest reply on Jan 7, 2004 8:16 PM by ioparra

    XA and NON-XA resource

    piotrkotlinski

      Hi,

      I have the following situation:

      1.I'm using Connector that does not supports XA
      transactions and database that supports (oralce).
      2.I have to perform transaction in SessionBean.

      The first solution is to use Bean Managed Transaction and play with commits and rollbacks.

      About second solution I'm not sure.

      Is it possible to start xa transaction which has one local transaction ?.

      I mean:
      1.) do prepare on xa-resource
      2.) do commit on non-xa resource
      3.) if commit succeed ,do commit on xa-resource otherwise rollback.

      Any ideas or better solution?

      Thanks in advance

      piotr

        • 1. Re: XA and NON-XA resource
          jueyu

          I think because you use a local connector,even if you use prepare,in fact jboss will do nothing in that invoke.

          • 2. Re: XA and NON-XA resource
            ioparra

            I don't know about third party connectors, but for local transactions of JDBC, the prepare is simply ignored during the XA calls. In fact, the local connection are wrapped by a dummy XA compliant interface. In this manner, transaction management is simplified, everything is XA.

            It may be possible that JBoss is doing this across the board for all Non-XA transaction(ie, wrapping it with an XA dummy wrapper).
            I haven't looked into the code for JCA since JB3.2.1. Please correct me if it has changed.

            Long story short, it should work but don't expect the data integrity during a rollback of either resource.
            -Ivan