1 2 Previous Next 20 Replies Latest reply on Jan 12, 2007 1:42 AM by Jochen Riedlinger

    JTS on JBoss 4.0.5 with Oracle

    Jochen Riedlinger Newbie

      Hello,

      I'm trying to use JBoss 4.0.5.GA with JTS (jbossts-full-4.2.2GA). I installed as decribed in the install_jts.txt and I found the info
      http://www.jboss.com/index.html?module=bb&op=viewtopic&t=97104 that two lines in the install_jts.txt are reversed.....

      My applications are deployed like that:
      app1 on node1 starts a transaction and insertrs some data to a oracle datasource. within that transaction app2 on node2 gets called and inserts data to another datasource (same database, but differend schema).

      I use Oracle thin driver 10.1.0.2 and have the datasources configured as <xa-datasource>.

      Unfortujnately I get the following error:
      12:23:41,051 WARN [JDBCExceptionReporter] SQL Error: 2051, SQLState: 42000
      12:23:41,051 ERROR [JDBCExceptionReporter] ORA-02051: another session in same transaction failed

      12:23:41,051 WARN [JDBCExceptionReporter] SQL Error: 2051, SQLState: 42000
      12:23:41,051 ERROR [JDBCExceptionReporter] ORA-02051: Eine weitere Session in derselben Transaktion war nicht erfolgreich

      12:23:41,051 ERROR [AbstractFlushingEventListener] Could not synchronize database state with session
      org.hibernate.exception.SQLGrammarException: Could not execute JDBC batch update
      at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:67)

      ....
      .....
      ......
      12:23:41,082 WARN [loggerI18N] [com.arjuna.ats.internal.jts.orbspecific.coordinator.generror] ArjunaTransactionImple.doBeforeCompletion caught exception: org.omg.CORBA.UNKNOWN: Server-side Exception: vmcid: 0x0 minor code: 0 completed: No
      12:23:41,082 WARN [arjLoggerI18N] [com.arjuna.ats.arjuna.coordinator.BasicAction_43] - Transaction -69b8f4be:792:459b9105:91 marked as rollback only. Will abort.
      12:23:41,285 WARN [controller] rid: 10 opname: _is_a cannot process request, because object doesn't exist
      12:23:41,285 WARN [controller] rid: 10 opname: _is_a request rejected with exception:
      12:23:41,301 WARN [controller] rid: 8 opname: rollback cannot process request, because object doesn't exist
      12:23:41,301 WARN [controller] rid: 8 opname: rollback request rejected with exception:


      Can anybody help me and give me a hint what went wrong?

      Thanks
      Jochen

        • 1. Re: JTS on JBoss 4.0.5 with Oracle
          Mark Little Master

          The lower portion of your stack trace is a result of the fact that something is trying to commit a transaction that has been previously marked as rollback_only. That's not allowed and the warning states what the result will now be, i.e., that the transaction will roll back. If you're using a distributed transaction, then it may be that a downstream node (interposed coordinator) has been marked as rollback_only and the upstream node (the parent coordinator) doesn't now about this until it tries to commit the transaction.

          • 2. Re: JTS on JBoss 4.0.5 with Oracle
            Quande Ren Newbie

            I had the same problem. I solved it by using physical different databases. Since you are testing the distributed transactions, I believe it is expected that the databases should not be the same.

            • 3. Re: JTS on JBoss 4.0.5 with Oracle
              Mark Little Master

              No, you should be able to involve the same backend datasource in different transactions concurrently.

              • 4. Re: JTS on JBoss 4.0.5 with Oracle
                Jochen Riedlinger Newbie

                Thanks for the quick reply!

                I don't think that the "inner" transaction gets marked as rollback_only. Do you think the data is incorrect? If I use equivalent data and my applications are both deployed on a standard jboss (with no JBoss Transactions) everything works fine. I use container managed transactions with Hibernate from stateless session beans.

                Do I have to change something in the hibernate configuration file?

                I configured hibernate in the jboss-service.xml file like this:

                <attribute name="TransactionStrategy">org.hibernate.transaction.CMTTransactionFactory</attribute>
                <attribute name="TransactionManagerLookupStrategy">org.hibernate.transaction.JBossTransactionManagerLookup</attribute>




                • 5. Re: JTS on JBoss 4.0.5 with Oracle
                  Mark Little Master

                   

                  12:23:41,082 WARN [arjLoggerI18N] [com.arjuna.ats.arjuna.coordinator.BasicAction_43] - Transaction -69b8f4be:792:459b9105:91 marked as rollback only. Will abort.


                  is definitely because a transaction is being told to commit when it has already been marked for rollback_only. Whether or not that is the root problem is a different matter. I suspect not.

                  Do you really need distributed transactions for this example? You say you can go back to the old TM and everything works. Since that doesn't support distributed transactions, I assume the answer to my question is: no, you don't need distributed transactions. If that is the case then I would suggest you try with the local JTA implementation of JBossTS to start with - just to remove any unwanted variables from the equation.

                  • 6. Re: JTS on JBoss 4.0.5 with Oracle
                    Jochen Riedlinger Newbie

                    I think we need distributed transactions. Our production environment is quite different from what I'm doing.

                    We have an ejb-application that writes to a database and then calls another ejb-application which also writes to the database (same database, but different schema --> different datasource). all theses steps should occur in the same transaction. And the second ejb is on a different node of our JBoss cluster than the first one.

                    To get this working we need distibuted transactions, don't we?

                    • 7. Re: JTS on JBoss 4.0.5 with Oracle
                      Mark Little Master

                      But you say that this works fine with JBoss TM, which doesn't support distributed transactions. Correct?

                      • 8. Re: JTS on JBoss 4.0.5 with Oracle
                        Jochen Riedlinger Newbie

                        No. That's what we want, but we don't have yet.

                        At the moment ejb-app1 and ejb-app2 are both deployed on all JBoss instances.
                        But we want to put them on seperate cluster-nodes (actually we have about ten ejb-applications and want to be flexible how to distribute them on different JBoss nodes in the cluster).

                        That'Äs why I'm trying to use JBoss Transactions

                        • 9. Re: JTS on JBoss 4.0.5 with Oracle
                          Mark Little Master

                           

                          If I use equivalent data and my applications are both deployed on a standard jboss (with no JBoss Transactions) everything works fine.


                          So by "standard jboss" you mean a single instance of the application server? In that case, do what I suggested and try the local JTA implementation from JBossTS first to ensure that gives the expected results.

                          • 10. Re: JTS on JBoss 4.0.5 with Oracle
                            Jochen Riedlinger Newbie

                            o.k. I'm going to do that tomorrow. now it's quitting time;-)

                            thank you!

                            • 11. Re: JTS on JBoss 4.0.5 with Oracle
                              Jochen Riedlinger Newbie

                              I just did one more test:

                              I only had only one Clusternode with JTS and both applications on it. The writing to the database seems to be o.k., but I get the following output:

                              17:46:36,785 WARN [controller] rid: 1526 opname: shouldMerge cannot process request, because object doesn't exist
                              17:46:36,785 WARN [controller] rid: 1526 opname: shouldMerge request rejected with exception:
                              17:46:36,801 WARN [controller] rid: 1528 opname: shouldReplace cannot process request, because object doesn't exist
                              17:46:36,801 WARN [controller] rid: 1528 opname: shouldReplace request rejected with exception:
                              17:46:36,801 WARN [controller] rid: 1530 opname: shouldAdd cannot process request, because object doesn't exist
                              17:46:36,801 WARN [controller] rid: 1530 opname: shouldAdd request rejected with exception:
                              17:46:36,801 WARN [controller] rid: 1532 opname: shouldAlter cannot process request, because object doesn't exist
                              17:46:36,801 WARN [controller] rid: 1532 opname: shouldAlter request rejected with exception:
                              17:46:36,817 WARN [controller] rid: 1536 opname: shouldMerge cannot process request, because object doesn't exist
                              17:46:36,817 WARN [controller] rid: 1536 opname: shouldMerge request rejected with exception:
                              17:46:36,817 WARN [controller] rid: 1538 opname: shouldReplace cannot process request, because object doesn't exist
                              17:46:36,817 WARN [controller] rid: 1538 opname: shouldReplace request rejected with exception:
                              17:46:36,832 WARN [controller] rid: 1540 opname: shouldAdd cannot process request, because object doesn't exist
                              17:46:36,832 WARN [controller] rid: 1540 opname: shouldAdd request rejected with exception:
                              17:46:36,832 WARN [controller] rid: 1542 opname: shouldAlter cannot process request, because object doesn't exist
                              17:46:36,832 WARN [controller] rid: 1542 opname: shouldAlter request rejected with exception:
                              17:46:36,832 WARN [controller] rid: 1544 opname: shouldMerge cannot process request, because object doesn't exist
                              17:46:36,848 WARN [controller] rid: 1544 opname: shouldMerge request rejected with exception:
                              17:46:36,863 WARN [controller] rid: 1546 opname: shouldReplace cannot process request, because object doesn't exist
                              17:46:36,863 WARN [controller] rid: 1546 opname: shouldReplace request rejected with exception:
                              17:46:36,879 WARN [controller] rid: 1548 opname: shouldAdd cannot process request, because object doesn't exist
                              17:46:36,879 WARN [controller] rid: 1548 opname: shouldAdd request rejected with exception:
                              17:46:36,879 WARN [controller] rid: 1550 opname: shouldAlter cannot process request, because object doesn't exist
                              17:46:36,879 WARN [controller] rid: 1550 opname: shouldAlter request rejected with exception:



                              But I just noticed that our flat-file-connector which writes a textfile to a network-share wasn't able to write the file (in the "inner"-transaction)....without throwing any Exception.

                              • 12. Re: JTS on JBoss 4.0.5 with Oracle
                                Jochen Riedlinger Newbie

                                Hello Mark,

                                as you suggested I tried to run our .ear-Files in a JBoss configured with the local JTA implementation. The Database transactions seems to work fine (only our JCA Adaptor for writiing Files doesn't work anymore, but without throwing an Exception???!!! There's just no file written.):

                                1. app1 starts transaction
                                2. app1 inserts data to database
                                3. app1 calls app2
                                4. app2 reads the data inserted before by app1
                                5. app2 inserts data to another datasource on the same database
                                6. JCA Adator for writiing files to filesystem CANNOT save file, but there's no Exception!!!!
                                7. commit succeeds

                                Except for the file-connector everything works as expected.

                                After this test I again tried to use the JTS version. I put app1 on node1 of the cluster and app2 on node2.
                                Teh steps 1. - 4. are still running without Exception (in a "Standard" JBoss with noc JBoss Transactions configured or only the JTA Version Step 4 obviously doesn't work, because I can't read data in a different transaction that is not commited by the first transaction yet). So I can get one step further with JTS.
                                Unfortunately Step 5 crashes as described yesterday:

                                node2 says:



                                14:17:35,963 WARN [JDBCExceptionReporter] SQL Error: 2051, SQLState: 42000
                                14:17:35,963 ERROR [JDBCExceptionReporter] ORA-02051: Eine weitere Session in derselben Transaktion war nicht erfolgreich

                                14:17:35,963 WARN [JDBCExceptionReporter] SQL Error: 2051, SQLState: 42000
                                14:17:35,963 ERROR [JDBCExceptionReporter] ORA-02051: Eine weitere Session in derselben Transaktion war nicht erfolgreich

                                14:17:35,963 ERROR [AbstractFlushingEventListener] Could not synchronize database state with session
                                org.hibernate.exception.SQLGrammarException: Could not execute JDBC batch update
                                at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:67)
                                at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
                                ....
                                ....
                                ....
                                Caused by: java.sql.BatchUpdateException: ORA-02051: Eine weitere Session in derselben Transaktion war nicht erfolgreich

                                at oracle.jdbc.driver.DatabaseError.throwBatchUpdateException(DatabaseError.java:498)
                                at oracle.jdbc.driver.OraclePreparedStatement.executeBatch(OraclePreparedStatement.java:12410)
                                at org.jboss.resource.adapter.jdbc.WrappedStatement.executeBatch(WrappedStatement.java:519)
                                at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:48)
                                at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:242)
                                ... 12 more
                                14:17:35,994 WARN [loggerI18N] [com.arjuna.ats.internal.jts.orbspecific.coordinator.generror] ArjunaTransactionImple.doBeforeCompletion caught exception: org.omg.CORBA.UNKNOWN: Server-side Exception: vmcid: 0x0 minor code: 0 completed: No
                                14:17:36,010 WARN [arjLoggerI18N] [com.arjuna.ats.arjuna.coordinator.BasicAction_43] - Transaction -69b8f4be:7c9:459cfcc9:3a marked as rollback only. Will abort.
                                14:17:36,244 WARN [controller] rid: 10 opname: _is_a cannot process request, because object doesn't exist
                                14:17:36,244 WARN [controller] rid: 10 opname: _is_a request rejected with exception:
                                14:17:36,260 WARN [controller] rid: 8 opname: rollback cannot process request, because object doesn't exist
                                14:17:36,260 WARN [controller] rid: 8 opname: rollback request rejected with exception:


                                node1 says:

                                2007-01-04 14:17:36,212 WARN [com.arjuna.ats.arjuna.logging.arjLoggerI18N] [com.arjuna.ats.arjuna.coordinator.BasicAction_36] - BasicAction.End() - prepare phase of action-id -69b8f4be:7c9:459cfcc9:3a failed.
                                2007-01-04 14:17:36,212 WARN [com.arjuna.ats.arjuna.logging.arjLoggerI18N] [com.arjuna.ats.arjuna.coordinator.BasicAction_38] - Action Aborting
                                2007-01-04 14:17:36,228 DEBUG [org.jboss.mx.loading.RepositoryClassLoader] setRepository, repository=org.jboss.mx.loading.HeirarchicalLoaderRepository3@9d515, cl=org.jboss.mx.loading.HeirarchicalLoaderRepository3$CacheClassLoader@1e81bb3{ url=null ,addedOrder=0}
                                2007-01-04 14:17:36,259 ERROR [org.jboss.ejb.plugins.LogInterceptor] TransactionRolledbackException in method: public abstract java.lang.Long de.lbank.lego.kernel.ejb.LEgOKernelFacade.persistierenErsterfassungKomplett(de.lbank.lego.kernel.data.geburt.LEgOKernelGeburtValue,de.lbank.lego.kernel.data.adresse.LEgOKernelAdresseValue,de.lbank.lego.kernel.data.bkverbindung.LEgOKernelBankverbindungValue,de.lbank.lego.kernel.data.vorgang.LEgOKernelVorgangValue,java.lang.String) throws de.lbank.lego.exception.LEgOApplicationException,java.rmi.RemoteException, causedBy:
                                javax.transaction.RollbackException
                                at com.arjuna.ats.internal.jta.transaction.jts.TransactionImple.commit(TransactionImple.java:273)
                                at org.jboss.ejb.plugins.TxInterceptorCMT.endTransaction(TxInterceptorCMT.java:501)
                                at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:361)
                                at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:181)
                                at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:168)
                                at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:205)



                                Actually there's no reason why the insert in step 5 should fail. It works well if executed on the same clusternode.

                                I have no idea how to try further.....

                                Thanks
                                Jochen

                                • 14. Re: JTS on JBoss 4.0.5 with Oracle
                                  Jochen Riedlinger Newbie

                                  Hello qren,

                                  I must apologize that I ignored your posting after I read the follow up post:

                                  No, you should be able to involve the same backend datasource in different transactions concurrently.


                                  THIS IS NOT CORRECT.

                                  If the second application uses a second datasource which points to a different database (on the same physical machine) everything works perfectly.
                                  If the second datasource only points to another schema on the same Oracle database the above mentioned errors happen.

                                  But what should I do now? Actually that's not really acceptable, because our architecture is based on the schemas.
                                  Ist that a problem of JBossTS or of the Oracle XADriver???

                                  1 2 Previous Next