1 Reply Latest reply on Jul 9, 2008 1:31 PM by Rene Felgenträger

    long transaction

    Benito Juarez Newbie

      Hello,


      i got an error while processing a long running transaction (about 20 minutes)


      The entity manager is the seam managed one:


      @In
      private EntityManager entityManager;




      And the method looks like this:


      @Transactional(TransactionPropagationType.NEVER)
      public String doLongProcess() 
      {
         foreach line from big text file:
         {
             MyEntity e = new MyEntity(some data);
             entityManager.persist(e);
             entityManager.flush();
         }
      }




      After 10 Minutes one half of the text file is processed and the following error occours:



      11:20:09,366 INFO   MyActionBean.doLongProcess() Fehler javax.persistence.TransactionR
      equiredException: no transaction is in progress
              at org.hibernate.ejb.AbstractEntityManagerImpl.flush(AbstractEntityManagerImpl.java:293)
              at org.jboss.seam.persistence.EntityManagerProxy.flush(EntityManagerProxy.java:90)


      any hints?
      thx BJ


        • 1. Re: long transaction
          Rene Felgenträger Newbie

          JBOSS AS has a default transaction-timeout! In your case u must overwrite the default settings!


          look for this statement in the jboss-service.xml:



             <mbean code="com.arjuna.ats.jbossatx.jta.TransactionManagerService"
                name="jboss:service=TransactionManager">
                <attribute name="TransactionTimeout">300</attribute>
                <attribute name="ObjectStoreDir">${jboss.server.data.dir}/tx-object-store</attribute>      
             </mbean>



          the TransactionTimeout-property is weighted in seconds!


          greetings