6 Replies Latest reply on Apr 23, 2003 5:52 PM by David Jencks

    Need XA Wrapper in 3.2

    Mark Judd Newbie

      I am migrating from 2.4.7 to 3.2. In 2.4.7 JBoss supplied an XAWrapper class that provided XA functionality for databases that didn't support XA

      org.jboss.pool.jdbc.xa.wrapper.XADataSourceImpl

      We are using Sybase's Adaptive Server Anywhere which doesn't support XA but have to have XA functionality in our application.

      Is there an equivalent XA Wrapper for JBoss 3.x?

        • 1. Re: Need XA Wrapper in 3.2
          David Jencks Master

          Just because a class has "XA" in its name doesn't mean it provides any xa functionality. If you need 2pc, get a real xa database. Firebird is one, and it's free.

          The jdbc local wrapper replaces the 2.x XADataSourceImpl. I think there is an example config for sybase.

          Just as in 2.4, you can include more than one resource manager in a transaction, and if everything goes well you will have no problems. Just as with 2.x, if something does go wrong while committing you are risking inconsistent data.

          • 2. Re: Need XA Wrapper in 3.2
            Mark Judd Newbie

            Migrating to another database is not a simple matter. There are a lot of triggers and stored procedures involved as well as end-user issues.

            The problem with using a local datasource is that if you have 2 EJBs getting a connection in the same transaction, the local datasource can give you different connections, the XA datasource gives you the same connection.

            This worked with org.jboss.pool.jdbc.xa.wrapper.XADataSourceImpl

            Is there anyway to simulate this for JBoss 3.x?

            • 3. Re: Need XA Wrapper in 3.2
              David Jencks Master

              > Migrating to another database is not a simple matter.
              > There are a lot of triggers and stored procedures
              > involved as well as end-user issues.

              Who is talking about migrating to another database?
              >
              > The problem with using a local datasource is that if
              > you have 2 EJBs getting a connection in the same
              > transaction, the local datasource can give you
              > different connections, the XA datasource gives you
              > the same connection.

              You are the first person in the year this code has been available to claim that the local tx connection manager doesn't work properly in regards to always supplying the same ManagedConnection within a transaction. Do you have any evidence to back this up?
              >
              > This worked with
              > org.jboss.pool.jdbc.xa.wrapper.XADataSourceImpl
              >
              > Is there anyway to simulate this for JBoss 3.x?

              Use the local tx connection manager, as I stated before.

              • 4. Re: Need XA Wrapper in 3.2
                Mark Judd Newbie

                My statement in regards to the Local datasource not returning the same connection within a transaction is based on my experience with 2.4.x. That is why we needed to use the XA Wrapper, then.

                I have not tested this in 3.x, I assumed the behavior would be the same. I will test this and let you know the results.

                Thanks for your responses.

                • 5. Re: Need XA Wrapper in 3.2
                  Mark Judd Newbie

                  I am getting:

                  15:44:25,378 WARN [TxConnectionManager$LocalXAResource] Prepare called on a local tx. Use of local transactions on a jta transaction with more than one branch may result in inconsistent data in some cases of failure.

                  I am really going to experience any different behavior in 3.x using the local datasource as compared to 2.4.7 using the XADataSourceImpl or is it just that 2.4.7 didn't display a message to warn me of this?

                  • 6. Re: Need XA Wrapper in 3.2
                    David Jencks Master

                    Semantics are the same, I just provide a warning in case you don't know what you are doing.