2 Replies Latest reply on Dec 8, 2003 12:45 PM by Maurice Coyle

    multiple datasources in a transaction

    Maurice Coyle Newbie

      hi,
      this is a simple enough question regarding whether i should use xa-transactions or not.

      basically i know that if you're accessing multiple datasources within a transaction, you need to use xa transactions.

      my question is, what constitutes a datasource? is it a separate database or a table within a database?

      any insight appreciated,
      maurice

        • 1. Re: multiple datasources in a transaction
          rajaboobalan Newbie

          DATASOURCE is just a logical reference to the DATABASE. The credentials are checked only when you try to get a connection.

          • 2. Re: multiple datasources in a transaction
            Maurice Coyle Newbie

            hmm, well in that case i'm stumped.

            my application accesses an oracle database and no other datasource. i have transactions within it that access the database, some of which contain updates to more than 1 table in the DB.

            i'm getting a warning that says
            "2003-12-05 13:26:44,591 WARN [org.jboss.resource.connectionmanager.TxConnectionManager] 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 thought hopefully that the warning was harmless but it's causing my transactions to be rolled back. i never explicitly called prepare though.

            i read that xa transactions are required when more than 1 datasource was being updated but since i'm only using 1 db are they necessary?

            i was wondering if a transaction that contains more than 1 update to tables within the same database warrants the use of the XA transactions. if so, any helpful pointers on how to change over?

            thanks,
            maurice