4 Replies Latest reply on Mar 19, 2008 3:03 PM by Vicky Kak

    Why JBoss is using XA if I only have local-tx datasources

    Marcelo Alcantara Newbie

      Hi,

      As I understand, xa is for distributed transaction between different databases/instances.

      My JBoss just have local-tx datasources configured. No XA datasources.

      Why, in this scenario, JBoss still uses XA? There is a reason?

      I have clustered services enabled, does it relate?

      Thanks in advance.

      Marcelo

        • 1. Re: Why JBoss is using XA if I only have local-tx datasource
          Gary Snider Newbie

          You'll have to elaborate a little. What is the driver class in your local-tx datasource? If the driver doesn't support XA then it really won't matter what the app server is doing. (there's more to that but the point is we need to know what your configuration is)

          What are you seeing that makes you think JBoss is using XA?

          • 2. Re: Why JBoss is using XA if I only have local-tx datasource
            Vicky Kak Master

             

            "maralcbr" wrote:

            My JBoss just have local-tx datasources configured. No XA datasources.

            Why, in this scenario, JBoss still uses XA? There is a reason?


            I am sure you don't understand the reason for the existence of local-tx-datasource , do you understand the reason behind it ?

            local-tx-datasource are there to make the single one phase participant(db resource) to enable in the JTA transaction , this is done by LRCO(last resource commit optimization) . Read this one
            http://wiki.jboss.org/wiki/Wiki.jsp?page=Multiple1PC

            In case you are not using the global transaction (JTA) in your application code you can use no-tx-datasource.

            And finally the TransactionManger is smart enough to just call only the commit when it finds that there is only one participant in the JTA transaction , it can omit the prepare phase ;)


            • 3. Re: Why JBoss is using XA if I only have local-tx datasource
              Marcelo Alcantara Newbie

              Hi Vicky/gsniderJBoss,

              I have read the link you sent already. The JBossTS 2.3 programming guide too.

              Went through the topic below that has a lot to do with my doubt:

              http://www.jboss.com/index.html?module=bb&op=viewtopic&t=95617&postdays=0&postorder=asc&start=10

              Here is a part of my JBoss log where I can see it referencing a XA resource:
              ----------------
              [com.arjuna.ats.internal.jta.transaction.arjunacore.lastResource.multipleWarning] [com.arjuna.ats.internal.jta.transaction.arjunacore.lastResource.multipleWarning] Multiple last resources have been added to the current transaction. This is transactionally unsafe and should not be relied upon. Current resource is org.jboss.resource.connectionmanager.TxConnectionManager$LocalXAResource@6c4a07
              -----------------

              As I could see JBossTS does not allow more than one 1PC resource per transaction. Two datasources pointing to the same database are considered two resources. Right?

              My plan of action here is to enable the LRCO(last resource commit optimization) at first, and then enable XA at Oracle and convert our datasources from local to xa.

              What do you think of this?

              Thanks again.

              Marcelo

              • 4. Re: Why JBoss is using XA if I only have local-tx datasource
                Vicky Kak Master

                 

                "maralcbr" wrote:

                As I could see JBossTS does not allow more than one 1PC resource per transaction. Two datasources pointing to the same database are considered two resources. Right?

                Yes these are considered as two resources.
                Please go to the transaction user forum for Transaction related queries , this is JCA forum.
                Anyway have a look at the following link it will explain why having multiple one phase participants in JTA transaction are unsafe .
                http://wiki.jboss.org/wiki/Wiki.jsp?page=Multiple1PC