2 Replies Latest reply on Apr 1, 2009 2:13 PM by Marcos Vinicius

    org.jboss.tm.JBossRollbackException

    Joe Brown Newbie

      I have a stateless session bean which accesses an EJB3 entity. When I use entitymanager.find() it works fine, but when i do persist() i get the following error:


      org.jboss.tm.JBossRollbackException: Unable to commit, tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=jupiter/31, BranchQual=, localId=31] status=STATUS_NO_TRANSACTION; - nested throwable: (javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: Could not execute JDBC batch update)
      
      
      java.lang.RuntimeException: org.jboss.tm.JBossRollbackException: Unable to commit, tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=jupiter/31, BranchQual=, localId=31] status=STATUS_NO_TRANSACTION; - nested throwable: (javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: 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$RequiresNew.invoke(TxInterceptor.java:275) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101) at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101) at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101) at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:78) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101) at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:47) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101) at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106) at
      etc etc



      the method i am calling is:

      @TransactionAttribute(TransactionAttributeType.REQUIRES_
       public String mymethod() {
       ...
       entitymanager.persist(mybean);
       }



      where mybean is as follows:


      public class Mybean implements Serializable {

      @Id
      @Column (unique=true, nullable=false, length=32)
      private String name;

      public MyBean() {...}

      ..........




      any ideas why! it is driving me insane!


      i have been working on it for a week now... no success!

      thanks guys!