0 Replies Latest reply on Mar 6, 2006 11:51 PM by song hao

    org.jboss.tm.JBossRollbackException with change the Computer

    song hao Newbie

      I start Jboss, and include a EJB 3.0 MDB TestMDB(it connect to IBM MQ Series 5.2), a EJB 3.0 Persistence entity beans :Users.class, a EJB 3.0 Stateless Session Beans:TestUsers.class. Class TestUsers access Class Users like this:

      boolean Create_users(...) {
       try {
       Users ca = new Users();
       ......
       em.persist(ca);
       return true;
       } catch(Exception e) {
       return false;
       }
       }


      I start Jboss, all runs fine. and then I run a Client to call Class TestUser like this:

      try {
       initContext = new InitialContext();
       if(initContext != null) {
       TestUserRemote TU = (TestUserRemote) initContext.lookup("TestUser/remote");
       if(TU.Create_users(...)) {
       System.out.println("ok");
       } else {
       System.out.println("fail");
       }
       }
      } catch(Exception e) {
      }


      at first, I run Client program twice, it means I insert same data line twice.
      First time, TU.Create_users return true, Second time it return false.

      and then, I change computer's Date to tomorrow Date(for example:today is 2006-03-07, change to 2006-03-08), JBoss shows:

      12:40:14,771 ERROR [STDERR] 2006.03.08 12:40:14 MQJMS1023E ??????
      12:40:14,911 WARN [MDB] JMS provider failure detected:
      javax.jms.JMSException: MQJMS2002: ? MQ ????????
       at com.ibm.mq.jms.services.ConfigEnvironment.newException(ConfigEnvironm
      ent.java:530)
       at com.ibm.mq.jms.MQQueueAgentThread.browse(MQQueueAgentThread.java:509)
      
       at com.ibm.mq.jms.MQQueueAgentThread.run(MQQueueAgentThread.java:898)
       at java.lang.Thread.run(Thread.java:595)
      12:40:14,911 INFO [MDB] Trying to reconnect to JMS provider


      I run Client programe again(insert same data line), but TU.Create_users not return false. it shows:

      java.lang.RuntimeException: org.jboss.tm.JBossRollbackException: Unable to commit, tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=adver/18, BranchQual=, localId=18] status=STATUS_NO_TRANSACTION; - nested throwable: (org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update)
       at org.jboss.aspects.tx.TxPolicy.handleEndTransactionException(TxPolicy.java:198)
       at org.jboss.aspects.tx.TxPolicy.endTransaction(TxPolicy.java:180)
       at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:87)
       at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:192)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
       at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
      ..........
      Caused by: org.jboss.tm.JBossRollbackException: Unable to commit, tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=adver/18, BranchQual=, localId=18] status=STATUS_NO_TRANSACTION; - nested throwable: (org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update)
       at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:369)
       at org.jboss.aspects.tx.TxPolicy.endTransaction(TxPolicy.java:175)
       at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:87)
       at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:192)
      ...........
      Caused by: org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update
       at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:69)
       at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
       at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:202)
       at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:230)
      ...........
      Caused by: java.sql.BatchUpdateException: ORA-00001: ???????? (FIDS.SYS_C004233)
      
       at oracle.jdbc.dbaccess.DBError.throwBatchUpdateException(DBError.java:458)
       at oracle.jdbc.driver.OraclePreparedStatement.executeBatch(OraclePreparedStatement.java:3907)
       at org.jboss.resource.adapter.jdbc.WrappedStatement.executeBatch(WrappedStatement.java:517)
       at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:58)
       at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:195)
       ... 34 more



      I think that something trouble.