6 Replies Latest reply on Feb 9, 2003 5:02 AM by Uri

    JBoss 3.0.x and Oracle XA

    Zeev Bubis Newbie

      I've seen Igor Fedorenko's posting regarding JBoss 3.0.x and Oracle XA (http://www.jboss.org/modules/bb/index.html?module=bb&op=viewtopic&t=forums/ said there "Even if you would be able to configure oracle xa datasource, JBoss 3.0.x does not support oracle in XA. Oracle provides pretty crapy xa drivers and we were not able to workaround all their (known) problems until 3.2."

      I'm working on porting an application from WebLogic to JBoss and I've started with JBoss 3.0.4.
      I've configured the Oracle xa driver and I managed to read and write from the database. The problem I encounter is where I need to manage the connection directly (like changing the commit option) and I noticed that when invoking getConnection() on the DataSource (of class org.jboss.resource.adapter.jdbc.JDBCDataSource) - it returns a connection of type oracle.jdbc.driver.OracleConnection instead of oracle.jdbc.xa.client.OracleXADataSource (which is what is configured as the "XADataSourceClass" in oracle-xa-service.xml). Is this one of the known problems of JBoss 3.0.x with Oracle XA?

      What are the known problems with 3.0.x and Oracle XA?

      Thanks in advance,
      Ze'ev

        • 1. Re: JBoss 3.0.x and Oracle XA
          Zeev Bubis Newbie

          I made a mistake in my previous posting:
          I meant to say that it returns a connection of type oracle.jdbc.driver.OracleConnection instead of oracle.jdbc.xa.client.OracleXAConnection (and not DataSource) and of course not related to what is configured as the "XADataSourceClass".

          Ze'ev

          • 2. Re: JBoss 3.0.x and Oracle XA
            David Jencks Master

            I'm not sure of the exact problems, they end up being "it doesn't work". I strongly recommend using 3.2 with Oracle XA.

            I strongly recommend you do not change transaction isolation on individual connections. Normally this causes an immediate commit, which will interfere with the JTA transaction management. If you need connections at different isolation levels set up several pools, one at each isolation level.

            XAConnection implementations are needed only by the connectinon pooling code in a app server. Your application never needs to use them and should not try to get one. If you think you need to please explain in detail what you are trying to accomplish.

            • 3. Re: JBoss 3.0.x and Oracle XA
              Uri Newbie

              David,
              This might not be the most appropriate place to post this, but after searching JBoss forums and posting 2 unanswered messages, could you please clarify the level XA transactions are supported on JBoss 3.0.x?
              I've tried to configure it with oracle, SAPDB and MSSQL 2000, and failed on all three (they all seem to work at the beginning, but start throwing XA exceptions after a while). Maybe it's my bad, but I used the config files supplied with the distribution (3.0.2 and 3.0.4) and only changed the database specific parameters.
              I also consulted Benjamin Geer (who wrote the mssql-xa-service.xml file), who said that he also didn't get JBoss to work with XA datasource reliably. He said the database server would crash after about 80K transactions.
              Could you or someone else please clarify this, and if there's a problem with this feature, say which version will fix it?

              Thx,

              Uri

              • 4. Re: JBoss 3.0.x and Oracle XA
                David Jencks Master

                AFAIK any jca resource adapter that supports (my interpretation) of xa transactions will deploy and run fine on 3.0 or later. For instance, the jaybird jca-jdbc driver for the firebird database seems to work fine.

                However, there are 2 more issues:

                1. The xa jca jdbc wrapper in jboss 3 is less than satisfactory. I do not recommend using it for anything. It is replaced the 3.2 and 4.0 with completely different code.

                2.My interpretation of the xa spec appears to differ from the interpretation of most people who write XA drivers for relational databases. In my opinion the XA spec clearly specifies that an application server can, any time after starting a transaction, pick any connection to a particular managed resource, enroll it in the transaction using a single xid, and do work on it. In particular when doing several pieces of work within one transaction the app server can choose different connections for each piece of work. However most XA database drivers appear to require that you do all work with one xid over a single connection. In order to support this behavior I introduced a flag "TrackConnectionsByTx" in 3.2 and 4 that you can set to get the behavior expected by these drivers (in particular, Oracle).

                If you are interested in full xa semantics including distributed transactions and recovery you should be aware that:

                a) The jboss transaction manager in 3.0 and 3.2 does not support distributed transaction (one tx doing work in more than one jboss instance). I'm working on this in 4.0 and distributed transactions may work if you use the TrunkInvoker.

                b) The jboss transaction manager in 3.0 and 3.2 does not support recovery at all. I've implemented preliminary recovery support in 4.0 but I would consider this early alpha quality at best at this time.

                It may be possible to integrate Tyrex in 3.0 or 3.2 for distributed transaction support but apparently Tyrex does not support recovery.

                c) jbossmq does not support automatied recovery.

                • 5. Re: JBoss 3.0.x and Oracle XA
                  Uri Newbie

                  David,
                  Thx for the prompt reply. I have 3 questions:
                  - Regarding 2: Does this mean that in 3.0 I cannot use multiple connections in a single transaction (in Oracle for example), and is it related to a ResourceException I'm getting which says "associateConnection not supported"?
                  - Recovery support: You mean the TX managr does not call the recover() method of the associated resources incase of failure?
                  - What do you mean by "automated recovery"?

                  Uri

                  • 6. Re: JBoss 3.0.x and Oracle XA
                    Uri Newbie

                    David,
                    Thx for the prompt reply. I have 3 questions:
                    - Regarding 2: Does this mean that in 3.0 I cannot use multiple connections in a single transaction (in Oracle for example), and is it related to a ResourceException I'm getting which says "associateConnection not supported"?
                    - Recovery support: You mean the TX managr does not call the recover() method of the associated resources incase of failure?
                    - What do you mean by "automated recovery"?

                    Uri