2 Replies Latest reply on Sep 22, 2011 11:01 AM by iapazmino

    ARJUNA-16053 Could not commit transaction

    iapazmino

      Hello,

       

      I'm trying to persist some entities, cascading persist and merge, using a JBoss AS6.0.0.FInal server

       

      This is an excerpt of the entities structure:

       

      @Entity
      @Inheritance(strategy = InheritanceType.JOINED)
      public abstract class Solicitud {
      ...
          @ManyToOne(optional = false, targetEntity = Solicitante.class, cascade = { PERSIST, MERGE})
          public Contribuyente getContribuyente() {
              return this.contribuyente;
          }
      }
      
      @Entity
      public class SolicitudEmision extends Solicitud {
      ...
           @OneToOne(optional = false, targetEntity = SolicitudClaveAcceso.class, cascade = { PERSIST, MERGE })
          public SolicitudClaves getSolicitudClavesContingencia() {
              return this.solicitudClavesContingencia;
          }
      
          @ManyToMany(targetEntity = TipoComprobante.class, cascade = {PERSIST, MERGE})
          public List<TipoDocumentoElectronico> getTipoComprobantesSolicitados() {
              return comprobantesSolicitados;
          }
      }
      

       

      All relationships are unidirectional. The failing test declares a SolicitudEmision object and adds on it an instance of the cascaded types. All this records are to be inserted. Finally it uses invokes merge() in the EntityManager and passes the SolicitudEmision object.

       

      The thrown exception is as follows

       

      javax.ejb.EJBTransactionRolledbackException: Transaction rolled back
      ...
      Caused by: javax.transaction.RollbackException: ARJUNA-16053 Could not commit transaction.
      
          at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1170)
          at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.commit(BaseTransaction.java:119)
          at com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.commit(BaseTransactionManagerDelegate.java:75)
          at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.endTransaction(CMTTxInterceptor.java:82)
          ... 132 more
      

       

      Running on a JBoss AS6.1.0.Final server causes the exact same error.

       

      What might be causing this error?

       

      Thanks in advance

        • 1. Re: ARJUNA-16053 Could not commit transaction
          iapazmino

          I've realized this error was the same for both servers since I copied hibernate libraries from 6.1.0.Final to 6.0.0.Final.

          Once the hibernate libraries on 6.0.0.Final have restored the error cahnged to

           

          null entities are not supported by org.hibernate.event.def.EventCache
          2011-09-20 15:57:15,641 DEBUG [org.jboss.jpa.deployment.ManagedEntityManagerFactory] (http-localhost%2F127.0.0.1-8080-1) ************** closing entity managersession **************
          

           

          I've made sure every class' field has been set to nullable = false and assigned a value, but still same errors in every as server.

          • 2. Re: ARJUNA-16053 Could not commit transaction
            iapazmino

            This has been solved setting every column to nullable = false and, of course, setting a value for every column when trying to save.

            Besides that, corrected a JoinTable in the ManyToMany relationship.