12 Replies Latest reply on Aug 9, 2002 1:53 PM by timfox

    Transaction Manager Login denied

    timfox

      I'm using 3.0.1, with Oracle8.1.6 and XA transactions

      Intermittently oracle gives me the following error:

      "ORA-02044: transaction manager login denied: transaction in progress"

      This ONLY seems to happen when there are two concurrent XA transactions from 2 concurrent client calls, in the container at once.

      Any ideas?

        • 1. Re: Transaction Manager Login denied
          timfox

          Apologies for the vague description. Here's some more info:

          The line of code that calls Oracle is:
          org.jboss.tm.TxCapsule.startResource(TxCapsule.java:1180)

          Basically it's calling "start" on the resource.
          I would guess what Oracle means by "login denied, transaction in progress", is that start has already been called once, and oracle is complaining that this would be a "protocol error" to call it again.
          Anyway, that's just a guess.
          Ominously, just before the call to start, I notice the following comment in the code:

          // OSH FIXME: resourceState could be incorrect during this callout.

          Which makes me somewhat uneasy - maybe this is a known problem (??)

          From a cursory look at the code, and it is VERY cursory, so forgive me if I am barking up the wrong tree, but it looks like some sort of lock or mutex is released during the call to start, implying to me that a race condition could occur with start being called with the resource in the wrong state.

          Here is the full stack trace, btw I am using mvcsoft as well, although I guess that should make little difference:


          2002-08-11 16:24:52,654 ERROR [STDERR] java.sql.SQLException: ORA-02044: transaction manager login denied: transaction in progress
          ORA-06512: at "SYS.JAVA_XA", line 0
          ORA-06512: at line 1
          2002-08-11 16:24:52,664 ERROR [STDERR] at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)
          2002-08-11 16:24:52,664 ERROR [STDERR] at oracle.jdbc.oci8.OCIDBAccess.check_error(OCIDBAccess.java:1597)
          2002-08-11 16:24:52,674 ERROR [STDERR] at oracle.jdbc.oci8.OCIDBAccess.executeFetch(OCIDBAccess.java:1209)
          2002-08-11 16:24:52,704 ERROR [STDERR] at oracle.jdbc.oci8.OCIDBAccess.parseExecuteFetch(OCIDBAccess.java:1321)
          2002-08-11 16:24:52,704 ERROR [STDERR] at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:1446)
          2002-08-11 16:24:52,714 ERROR [STDERR] at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:1371)
          2002-08-11 16:24:52,724 ERROR [STDERR] at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1900)
          2002-08-11 16:24:52,754 ERROR [STDERR] at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:363)
          2002-08-11 16:24:52,754 ERROR [STDERR] at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:407)
          2002-08-11 16:24:52,754 ERROR [STDERR] at oracle.jdbc.xa.client.OracleXAResource.start(OracleXAResource.java:171)
          2002-08-11 16:24:52,754 ERROR [STDERR] at org.jboss.tm.TxCapsule.startResource(TxCapsule.java:1180)
          2002-08-11 16:24:52,754 ERROR [STDERR] at org.jboss.tm.TxCapsule.endResources(TxCapsule.java:1303)
          2002-08-11 16:24:52,754 ERROR [STDERR] at org.jboss.tm.TxCapsule.commit(TxCapsule.java:340)
          2002-08-11 16:24:52,754 ERROR [STDERR] at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:73)
          2002-08-11 16:24:52,754 ERROR [STDERR] at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:199)
          2002-08-11 16:24:52,754 ERROR [STDERR] at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:61)
          2002-08-11 16:24:52,764 ERROR [STDERR] at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:129)
          2002-08-11 16:24:52,764 ERROR [STDERR] at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:183)
          2002-08-11 16:24:52,764 ERROR [STDERR] at org.jboss.ejb.StatelessSessionContainer.invoke(StatelessSessionContainer.java:313)
          2002-08-11 16:24:52,764 ERROR [STDERR] at org.jboss.ejb.Container.invoke(Container.java:705)
          2002-08-11 16:24:52,764 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:491)
          2002-08-11 16:24:52,764 ERROR [STDERR] at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:362)
          2002-08-11 16:24:52,764 ERROR [STDERR] at java.lang.reflect.Method.invoke(Native Method)
          2002-08-11 16:24:52,764 ERROR [STDERR] at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:236)
          2002-08-11 16:24:52,764 ERROR [STDERR] at sun.rmi.transport.Transport$1.run(Transport.java:147)
          2002-08-11 16:24:52,764 ERROR [STDERR] at java.security.AccessController.doPrivileged(Native Method)
          2002-08-11 16:24:52,764 ERROR [STDERR] at sun.rmi.transport.Transport.serviceCall(Transport.java:143)
          2002-08-11 16:24:52,764 ERROR [STDERR] at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
          2002-08-11 16:24:52,764 ERROR [STDERR] at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
          2002-08-11 16:24:52,764 ERROR [STDERR] at java.lang.Thread.run(Thread.java:479)
          2002-08-11 16:24:52,855 WARN [org.jboss.tm.TxCapsule] XAException: tx=XidImpl [FormatId=257, GlobalId=TECHIE//257, BranchQual=] errorCode=XAER_RMERR
          o

          • 2. Re: Transaction Manager Login denied
            timfox

            More on this.
            From Oracle:

            "Cause: A remote transaction manager tried to log in while a distributed transaction is in progress. A protocol error occurred in the remote transaction manager."

            Could there be race condition in the jboss transaction manager?

            • 3. Re: Transaction Manager Login denied
              davidjencks

              Without more context, the oracle message/explanation doesn't make much sense to me. Can you determine what they mean by a transaction manager logging in?

              • 4. Re: Transaction Manager Login denied
                timfox

                Apologies for the vague description. Here's some more info:

                The line of code that calls Oracle is:
                org.jboss.tm.TxCapsule.startResource(TxCapsule.java:1180)

                Basically it's calling "start" on the resource.
                I would guess what Oracle means by "login denied, transaction in progress", is that start has already been called once, and oracle is complaining that this would be a "protocol error" to call it again.
                Anyway, that's just a guess.
                Ominously, just before the call to start, I notice the following comment in the code:

                // OSH FIXME: resourceState could be incorrect during this callout.

                Which makes me somewhat uneasy - maybe this is a known problem (??)

                From a cursory look at the code, and it is VERY cursory, so forgive me if I am barking up the wrong tree, but it looks like some sort of lock or mutex is released during the call to start, implying to me that a race condition could occur with start being called with the resource in the wrong state.

                Here is the full stack trace, btw I am using mvcsoft as well, although I guess that should make little difference:


                2002-08-11 16:24:52,654 ERROR [STDERR] java.sql.SQLException: ORA-02044: transaction manager login denied: transaction in progress
                ORA-06512: at "SYS.JAVA_XA", line 0
                ORA-06512: at line 1
                2002-08-11 16:24:52,664 ERROR [STDERR] at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)
                2002-08-11 16:24:52,664 ERROR [STDERR] at oracle.jdbc.oci8.OCIDBAccess.check_error(OCIDBAccess.java:1597)
                2002-08-11 16:24:52,674 ERROR [STDERR] at oracle.jdbc.oci8.OCIDBAccess.executeFetch(OCIDBAccess.java:1209)
                2002-08-11 16:24:52,704 ERROR [STDERR] at oracle.jdbc.oci8.OCIDBAccess.parseExecuteFetch(OCIDBAccess.java:1321)
                2002-08-11 16:24:52,704 ERROR [STDERR] at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:1446)
                2002-08-11 16:24:52,714 ERROR [STDERR] at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:1371)
                2002-08-11 16:24:52,724 ERROR [STDERR] at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1900)
                2002-08-11 16:24:52,754 ERROR [STDERR] at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:363)
                2002-08-11 16:24:52,754 ERROR [STDERR] at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:407)
                2002-08-11 16:24:52,754 ERROR [STDERR] at oracle.jdbc.xa.client.OracleXAResource.start(OracleXAResource.java:171)
                2002-08-11 16:24:52,754 ERROR [STDERR] at org.jboss.tm.TxCapsule.startResource(TxCapsule.java:1180)
                2002-08-11 16:24:52,754 ERROR [STDERR] at org.jboss.tm.TxCapsule.endResources(TxCapsule.java:1303)
                2002-08-11 16:24:52,754 ERROR [STDERR] at org.jboss.tm.TxCapsule.commit(TxCapsule.java:340)
                2002-08-11 16:24:52,754 ERROR [STDERR] at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:73)
                2002-08-11 16:24:52,754 ERROR [STDERR] at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:199)
                2002-08-11 16:24:52,754 ERROR [STDERR] at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:61)
                2002-08-11 16:24:52,764 ERROR [STDERR] at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:129)
                2002-08-11 16:24:52,764 ERROR [STDERR] at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:183)
                2002-08-11 16:24:52,764 ERROR [STDERR] at org.jboss.ejb.StatelessSessionContainer.invoke(StatelessSessionContainer.java:313)
                2002-08-11 16:24:52,764 ERROR [STDERR] at org.jboss.ejb.Container.invoke(Container.java:705)
                2002-08-11 16:24:52,764 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:491)
                2002-08-11 16:24:52,764 ERROR [STDERR] at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:362)
                2002-08-11 16:24:52,764 ERROR [STDERR] at java.lang.reflect.Method.invoke(Native Method)
                2002-08-11 16:24:52,764 ERROR [STDERR] at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:236)
                2002-08-11 16:24:52,764 ERROR [STDERR] at sun.rmi.transport.Transport$1.run(Transport.java:147)
                2002-08-11 16:24:52,764 ERROR [STDERR] at java.security.AccessController.doPrivileged(Native Method)
                2002-08-11 16:24:52,764 ERROR [STDERR] at sun.rmi.transport.Transport.serviceCall(Transport.java:143)
                2002-08-11 16:24:52,764 ERROR [STDERR] at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
                2002-08-11 16:24:52,764 ERROR [STDERR] at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
                2002-08-11 16:24:52,764 ERROR [STDERR] at java.lang.Thread.run(Thread.java:479)
                2002-08-11 16:24:52,855 WARN [org.jboss.tm.TxCapsule] XAException: tx=XidImpl [FormatId=257, GlobalId=TECHIE//257, BranchQual=] errorCode=XAER_RMERR
                o

                • 5. Re: Transaction Manager Login denied
                  davidjencks

                  I think this is a more or less known problem being argued over in this bug:

                  http://sourceforge.net/tracker/index.php?func=detail&aid=590816&group_id=22866&atid=376685

                  I _think_ they've figured out something to try, whether it will work with Oracle is another question.

                  • 6. Re: Transaction Manager Login denied
                    timfox

                    Thanks for your reply.

                    I'm kind of worried about this whole xa thing. Since I moved from local to xa transactions I've had no end of problems, and when one disappears another rears it's head...

                    The only reason I'm using XA transactions at all, is because I'm doing some database access from inside message driven beans, and that didn't work with local jdbc transactions (I was getting prepare was called on local tx).

                    I'm thinking hard now, of ways I can avoid these XA transactions altogether - if I moved my db code out of the MDBs into some session beans, and set the transaction demarcation as RequiresNew, and called them from the MDBs perhaps that would work, and I can get back to the nice friendly world of local tx...

                    Does that sound like a feasible idea, or am I not making much sense?

                    • 7. Re: Transaction Manager Login denied
                      davidjencks

                      If you are willing to do that, you might as well just use local tx within your mdb and set the logging so you don't see my friendly warning message-- this is simpler and will have the same semantics.

                      • 8. Re: Transaction Manager Login denied
                        timfox

                        Sounds like an idea...
                        Do you know how I tell JBoss MQ to use local rather than XA transactions?

                        • 9. Re: Transaction Manager Login denied
                          davidjencks

                          I don't think it is possible or desirable. I meant to just use the local tx adapter for Oracle and leave the jms stuff xa.

                          • 10. Re: Transaction Manager Login denied
                            timfox

                            Ok, I shall try that.

                            Although that is the config. I had at the beginning, which didn't work, and is the reason I went to XA transactions at all. (!) - Hopefully the reason it didn't work was due to the version of Jboss at the time (3.0.0 I believe), and it's subsequently been fixed (?)

                            Basically I couldn't care 2 hoots about the transactional features of JMS, if there was some way I could just turn it off and just have one resource manager (database) that would be fantastic.

                            Basically I have this scenario:

                            Messages are sent to MDBs, the MDBs update entity beans (effectively BMP - although generated by Mvcsoft).
                            That's it...
                            Sounds incredibly simple... well it is. But it has proven extraordinarily difficult to accomplish. In fact it isn't accomplished reliably.

                            Anyway, I shall try again with local tx and report back with the results.


                            • 11. Re: Transaction Manager Login denied
                              timfox

                              David, I've tried with 3.0.1rc1 and local tx, and it does appear to working ok. :)

                              I'm getting the following warning as you predicted:
                              "prepare called on a local tx. You are not getting the semantics you expect!"

                              Can I just confirm with you this is ok, and not comprising the integrity of my app. in any way?

                              Thanks.

                              • 12. Re: Transaction Manager Login denied
                                davidjencks

                                Well, there are some failure scenarios in which your data will be left in an inconsistent state. EVERYTHING needs to be xa in order to prevent this. However, for perfect consistency you'd also need to use Tyrex for your transaction manager, since the jboss tx manager doesn't log transaction participants, thus preventing it from being able to recover from a crash.

                                If you don't understand why this is, you should look at a good book on transaction processing -- I can't really explain it in a post.

                                With the exception of needing Tyrex, I think we will have this problem solved soon. I have a new XA wrapper written that should be easy to subclass to overcome various driver problems, and we can get it and the tx manager to work with each other.