7 Replies Latest reply on Dec 4, 2002 11:10 AM by jmoring

    WARNING: prepare called on a local tx.

    jlmartinez

      we are using Jboss3.0.1 +Postgres 7.2. In the execution of some transactions a warning appear:
      WARN [LocalTxConnectionManager$LocalConnectionEventListener] prepare called on a local tx. You are not getting the semantics you expect!

      What's meant this warning ?

        • 1. Re: WARNING: prepare called on a local tx.
          davidjencks

          The transaction manager thinks there are 2 or more resource managers in the transaction, so it is calling prepare according to the 2pc protocol. However, at least one of the resource managers does not support 2pc. Failure during commit can leave your data in an inconstent state.

          Usually this is caused by using jms and jdbc in the same transaction.

          The solution is to ignore the message if transactional integrity is not 100% critical to your app or use the Tyrex transaction manager and only xa capable resource managers if it is. You can also adjust logging so this message does not appear.

          • 2. Re: WARNING: prepare called on a local tx.
            bpowell

            I am not using jms, only jdbc.
            I connect to sqlserver2000 with xa extended stored procedures installed.
            I get the warning using the LocalTxManager.
            If I use only the Local version then what does it have to do with XA or distributed transactions?
            I get the warning with the inet driver and the jtds driver.

            • 3. Re: WARNING: prepare called on a local tx.
              bpowell

              Will this excerpt from the maillist by David Jencks explain the messsage?
              >>The warning might mean: There is one xa participant so the user might
              >>expect to get full xa benefit but doesn't -> so warn.
              >
              >
              > It's supposed to mean, there is more than one participant and at least one
              > is non-xa, so be sure you know what you are doing.
              >
              Is this reply still valid?

              • 4. Re: WARNING: prepare called on a local tx.

                I get this warning when I use 2 connections (SQLServer2000 INet Opta driver) in the same transaction using the LocalTxManager. In my case the 2 connections are to 2 different databases on the same server. One only reads while the other updates. Everything seems to work just fine (it has been in production of 3 months) but the volume of warning log enties makes it a pain. I switched to using the XaTxManager and all works well with no warnings. The long and short of it is the warning is potentailly ignorable but very annoying.

                HTH

                • 5. Re: WARNING: prepare called on a local tx.
                  bpowell

                  that is exactly my scenario.
                  i guess i will have to go to XA DSs.
                  thanks
                  Bruce

                  • 6. Re: WARNING: prepare called on a local tx.
                    cbourque

                    Can somebody please post a sample configuration file for this setup :

                    - JBoss 3.x
                    - MSSQL 2000
                    - i-net OPTA 2000
                    - XA DataSource

                    Regards

                    Christian

                    • 7. Re: WARNING: prepare called on a local tx.

                      Here you go!

                      HTH