2 Replies Latest reply on Sep 1, 2006 5:57 AM by kconner

    Transaction timing out

    srki

      I have a problem with transaction timing out and I know how to increase the time out interval but I would just like to learn as to what exactly is going on and how I can fix the problem without increasing the timeout.

      class RequestProcessor {

      public void do() {

      // very long process
      doSomeWhereLongProcess()
      .....
      // retrieve another session bean
      persistence = (IPersistence) ctx.lookup( IPersistence.JNDI_NAME );
      persistence.insert()
      .....


      doSomeProcess();
      }
      }

      public class PersistenceFacade implements IPersistence {
      @PersistenceContext
      private EntityManager em;

      // calls an entityManager to retrieve
      public void retrieve()

      }

      RequestProcessor is a session bean that is being called remotely. In ejb-jar.xml transaction type is set to Bean.
      It calls another session bean called PeristenceFacade that contains entity manager to insert entity beans. The transaction type in PersistenceFace
      is set to Container.


      While still executing a doSomeWhereLongProcess I get notification in log that transaction timed out and when it tries to called PersistenceFacade
      I get an exception. What would it start a transaction even before I looked up a PersistenceFacade?

      I tried setting transaction type to Bean in PersistenceFacade but it is complaining that EntityManager must have a transaction.

      What is the proper way of handling this type of scenario?

      Thanks


        • 1. Re: Transaction timing out
          srki

          Is it possible to get more info about a particular transaction from the globalId that is printed in the log?

          Thanks

          • 2. Re: Transaction timing out
            kconner

            Apologies for the delay in responding.

            What is calling the session bean? Is that within a transactional context?

            You can enable TRACE logging on org.jboss.tm.TransactionImpl for more information about transactions.