2 Replies Latest reply on Mar 16, 2010 1:12 PM by Alexander Hartner

    Setting default timeout on user managed transaction

    Alexander Hartner Expert

      I am using a user managed transaction and an entity manager inside a message driven bean. The process can take several minutes to complete and depending on the state of the environment, concurrent load etc. From time to time it happens that the entity manager reports the following exception

      failed to lazily initialize a collection of role: com.abc.entities.ChannelJob.m_jobProperties, no session or session was closed

      This is reported about 11 minutes after the last interaction and only happens when things run particularly slow. My suspicion is that this exception happens when the underlying transaction timed-out and the entity manager tries to load an object thereafter. I tried to increase the transaction timeout by modifying the global setting


      <!-- JBoss Transactions JTA -->

         <mbean code="com.arjuna.ats.jbossatx.jta.TransactionManagerService"


            <attribute name="TransactionTimeout">3600</attribute>

            <attribute name="ObjectStoreDir">${jboss.server.data.dir}/tx-object-store</attribute>



      however this didn't resolve the problem. I know I can set the timeout on the user transaction explicitly, however since this cause of this issue is environmental I would prefer to change it globally outside the application. My question is where is the default timeout for UserManaged transaction set and what is it's value ?


      Thanks in advance


        • 1. Re: Setting default timeout on user managed transaction
          Alexander Hartner Expert

          I am still struggling with understanding why the transaction stopped working. I am guessing it timed out, but there are no log messages to that effect. Any suggestions what I can do to diagnose this issue further.


          Thanks in advance.

          • 2. Re: Setting default timeout on user managed transaction
            Alexander Hartner Expert

            What I found after further investigation into this issue that every time this problem occurs shortly before the following messages are reported

            2010-03-09 14:52:58,174 WARN  [com.arjuna.ats.arjuna.logging.arjLoggerI18N] [com.arjuna.ats.arjuna.coordinator.BasicAction_58] - Abort of action id -3f57fdae:f7ad:4b965bf5:2855 invoked while multiple threads active within it.


            2010-03-09 14:52:58,174 WARN  [com.arjuna.ats.arjuna.logging.arjLoggerI18N] [com.arjuna.ats.arjuna.coordinator.CheckedAction_2] - CheckedAction::check - atomic action -3f57fdae:f7ad:4b965bf5:2855 aborting with 1 threads active!

            They seem to suggest that the same transaction is being accessed by multiple threads, however I don't do any explicit thread creation in the application. Are there any options to diagnose the cause of this issue further. I saw the post on the WIKI relating to a similar issue

            http://community.jboss.org/wiki/TxMultipleThreads however since I don't create any new threads I expect the cause would be a timeout. Since the error I encounter happens well before the timeout (which I set to 3600) I don't think the global timeout is taken effect to bean managed transaction. This leads me back to my question on where the default timeout setting for user managed transactions are set.


            thanks in advance