6 Replies Latest reply on Feb 11, 2013 7:53 AM by Nicklas Karlsson

    How To set transactions not to time out?

    Noa Drach Novice

      Hello,

       

      I read here https://community.jboss.org/post!input.jspa?container=2279&containerType=14 that if you set the value of default time out to 0 than the transactions are marked not to timeout.

       

      so i set

       

      <subsystem xmlns="urn:jboss:domain:transactions:1.1">
           <recovery-environment socket-binding="txn-recovery-environment" status-socket-binding="txn-status-manager"/>
                <coordinator-environment default-timeout="0"/>
      </subsystem> 
      
      
      
      
      

       

      but it didn't work for me - so i set it to very large number and now it looks better.

       

      Can you help me understand if it is possible to set transacations not to timeout?

       

      Thanks,

      Noa

        • 2. Re: How To set transactions not to time out?
          Nicklas Karlsson Master

          That documentation is for EAP 5 so not sure how far it applies. I haven't checked in the code if 0 is supposed to disable it (although that sounds natural). The XSD doesn't explicitly mention this.

          • 3. Re: How To set transactions not to time out?
            Noa Drach Novice

            so basically you are saying there is no offical way to set transacations not to timeout.

             

            so what else do i need to change in order to make my transactions longer - because i set the value to close to 2 hours and I get errors that are related to messaging timeout like:

             

            10/02/2013 19:39:49,200 ERROR [stderr] (Thread-3 (HornetQ-client-global-threads-13572222)) java.lang.ClassCastException: org.hornetq.core.protocol.core.impl.wireformat.SessionXAResponseMessage cannot be cast to org.hornetq.core.protocol.core.impl.wireformat.SessionXASetTimeoutResponseMessage
             10/02/2013 19:39:49,200 ERROR [stderr] (Thread-3 (HornetQ-client-global-threads-13572222))           at org.hornetq.core.client.impl.ClientSessionImpl.setTransactionTimeout(ClientSessionImpl.java:1598)
             10/02/2013 19:39:49,200 ERROR [stderr] (Thread-3 (HornetQ-client-global-threads-13572222))           at org.hornetq.core.client.impl.DelegatingSession.setTransactionTimeout(DelegatingSession.java:498)
             10/02/2013 19:39:49,200 ERROR [stderr] (Thread-3 (HornetQ-client-global-threads-13572222))           at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.enlistResource(TransactionImple.java:611)
             10/02/2013 19:39:49,200 ERROR [stderr] (Thread-3 (HornetQ-client-global-threads-13572222))           at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.enlistResource(TransactionImple.java:397)
             10/02/2013 19:39:49,200 ERROR [stderr] (Thread-3 (HornetQ-client-global-threads-13572222))           at org.jboss.as.ejb3.inflow.MessageEndpointInvocationHandler.beforeDelivery(MessageEndpointInvocationHandler.java:110)
             10/02/2013 19:39:49,216 ERROR [stderr] (Thread-3 (HornetQ-client-global-threads-13572222))           at sun.reflect.GeneratedMethodAccessor52.invoke(Unknown Source)
             10/02/2013 19:39:49,216 ERROR [stderr] (Thread-3 (HornetQ-client-global-threads-13572222))           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
             10/02/2013 19:39:49,216 ERROR [stderr] (Thread-3 (HornetQ-client-global-threads-13572222))           at java.lang.reflect.Method.invoke(Method.java:597)
             10/02/2013 19:39:49,216 ERROR [stderr] (Thread-3 (HornetQ-client-global-threads-13572222))           at org.jboss.as.ejb3.inflow.AbstractInvocationHandler.handle(AbstractInvocationHandler.java:60)
             10/02/2013 19:39:49,216 ERROR [stderr] (Thread-3 (HornetQ-client-global-threads-13572222))           at org.jboss.as.ejb3.inflow.MessageEndpointInvocationHandler.doInvoke(MessageEndpointInvocationHandler.java:136)
             10/02/2013 19:39:49,216 ERROR [stderr] (Thread-3 (HornetQ-client-global-threads-13572222))           at org.jboss.as.ejb3.inflow.AbstractInvocationHandler.invoke(AbstractInvocationHandler.java:73)
             10/02/2013 19:39:49,216 ERROR [stderr] (Thread-3 (HornetQ-client-global-threads-13572222))           at $Proxy57.beforeDelivery(Unknown Source)
             10/02/2013 19:39:49,216 ERROR [stderr] (Thread-3 (HornetQ-client-global-threads-13572222))           at org.hornetq.ra.inflow.HornetQMessageHandler.onMessage(HornetQMessageHandler.java:267)
             10/02/2013 19:39:49,216 ERROR [stderr] (Thread-3 (HornetQ-client-global-threads-13572222))           at org.hornetq.core.client.impl.ClientConsumerImpl.callOnMessage(ClientConsumerImpl.java:983)
             10/02/2013 19:39:49,216 ERROR [stderr] (Thread-3 (HornetQ-client-global-threads-13572222))           at org.hornetq.core.client.impl.ClientConsumerImpl.access$400(ClientConsumerImpl.java:48)
             10/02/2013 19:39:49,216 ERROR [stderr] (Thread-3 (HornetQ-client-global-threads-13572222))           at org.hornetq.core.client.impl.ClientConsumerImpl$Runner.run(ClientConsumerImpl.java:1113)
             10/02/2013 19:39:49,216 ERROR [stderr] (Thread-3 (HornetQ-client-global-threads-13572222))           at org.hornetq.utils.OrderedExecutorFactory$OrderedExecutor$1.run(OrderedExecutorFactory.java:100)
             10/02/2013 19:39:49,216 ERROR [stderr] (Thread-3 (HornetQ-client-global-threads-13572222))           at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
             10/02/2013 19:39:49,216 ERROR [stderr] (Thread-3 (HornetQ-client-global-threads-13572222))           at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
             10/02/2013 19:39:49,216 ERROR [stderr] (Thread-3 (HornetQ-client-global-threads-13572222))           at java.lang.Thread.run(Thread.java:619)
            
            

             

            and:

             

            
            11/02/2013 09:22:28,184 ERROR [stderr] (Thread-3408 (HornetQ-client-global-threads-13572222)) javax.transaction.xa.XAException
              11/02/2013 09:22:28,184 ERROR [stderr] (Thread-3408 (HornetQ-client-global-threads-13572222))           at org.hornetq.core.client.impl.ClientSessionImpl.start(ClientSessionImpl.java:1642)
              11/02/2013 09:22:28,184 ERROR [stderr] (Thread-3408 (HornetQ-client-global-threads-13572222))           at org.hornetq.core.client.impl.DelegatingSession.start(DelegatingSession.java:513)
              11/02/2013 09:22:28,184 ERROR [stderr] (Thread-3408 (HornetQ-client-global-threads-13572222))           at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.enlistResource(TransactionImple.java:636)
              11/02/2013 09:22:28,184 ERROR [stderr] (Thread-3408 (HornetQ-client-global-threads-13572222))           at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.enlistResource(TransactionImple.java:397)
              11/02/2013 09:22:28,184 ERROR [stderr] (Thread-3408 (HornetQ-client-global-threads-13572222))           at org.jboss.as.ejb3.inflow.MessageEndpointInvocationHandler.beforeDelivery(MessageEndpointInvocationHandler.java:110)
              11/02/2013 09:22:28,184 ERROR [stderr] (Thread-3408 (HornetQ-client-global-threads-13572222))           at sun.reflect.GeneratedMethodAccessor52.invoke(Unknown Source)
              11/02/2013 09:22:28,200 ERROR [stderr] (Thread-3408 (HornetQ-client-global-threads-13572222))           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              11/02/2013 09:22:28,200 ERROR [stderr] (Thread-3408 (HornetQ-client-global-threads-13572222))           at java.lang.reflect.Method.invoke(Method.java:597)
              11/02/2013 09:22:28,200 ERROR [stderr] (Thread-3408 (HornetQ-client-global-threads-13572222))           at org.jboss.as.ejb3.inflow.AbstractInvocationHandler.handle(AbstractInvocationHandler.java:60)
              11/02/2013 09:22:28,200 ERROR [stderr] (Thread-3408 (HornetQ-client-global-threads-13572222))           at org.jboss.as.ejb3.inflow.MessageEndpointInvocationHandler.doInvoke(MessageEndpointInvocationHandler.java:136)
              11/02/2013 09:22:28,200 ERROR [stderr] (Thread-3408 (HornetQ-client-global-threads-13572222))           at org.jboss.as.ejb3.inflow.AbstractInvocationHandler.invoke(AbstractInvocationHandler.java:73)
              11/02/2013 09:22:28,200 ERROR [stderr] (Thread-3408 (HornetQ-client-global-threads-13572222))           at $Proxy57.beforeDelivery(Unknown Source)
              11/02/2013 09:22:28,200 ERROR [stderr] (Thread-3408 (HornetQ-client-global-threads-13572222))           at org.hornetq.ra.inflow.HornetQMessageHandler.onMessage(HornetQMessageHandler.java:267)
              11/02/2013 09:22:28,200 ERROR [stderr] (Thread-3408 (HornetQ-client-global-threads-13572222))           at org.hornetq.core.client.impl.ClientConsumerImpl.callOnMessage(ClientConsumerImpl.java:983)
              11/02/2013 09:22:28,200 ERROR [stderr] (Thread-3408 (HornetQ-client-global-threads-13572222))           at org.hornetq.core.client.impl.ClientConsumerImpl.access$400(ClientConsumerImpl.java:48)
              11/02/2013 09:22:28,200 ERROR [stderr] (Thread-3408 (HornetQ-client-global-threads-13572222))           at org.hornetq.core.client.impl.ClientConsumerImpl$Runner.run(ClientConsumerImpl.java:1113)
              11/02/2013 09:22:28,200 ERROR [stderr] (Thread-3408 (HornetQ-client-global-threads-13572222))           at org.hornetq.utils.OrderedExecutorFactory$OrderedExecutor$1.run(OrderedExecutorFactory.java:100)
              11/02/2013 09:22:28,200 ERROR [stderr] (Thread-3408 (HornetQ-client-global-threads-13572222))           at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
              11/02/2013 09:22:28,216 ERROR [stderr] (Thread-3408 (HornetQ-client-global-threads-13572222))           at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
              11/02/2013 09:22:28,216 ERROR [stderr] (Thread-3408 (HornetQ-client-global-threads-13572222))           at java.lang.Thread.run(Thread.java:619)
            
            
            • 4. Re: How To set transactions not to time out?
              Nicklas Karlsson Master

              I never say anything official ;-)

               

              I just glanced at some JBossTM code and it would look that even if you passed along no default-timeout in standalone-xml, it would start off with a 60s value in the CoordinatorEnvironmentBean. I didn't track down usage of this value further to see if a value of -1 or something would result in no reaper being called at all.

              • 5. Re: How To set transactions not to time out?
                Noa Drach Novice

                Got it - thanks.

                 

                do you have any other comments on what I did wrong in orchestrating the transactions attribute and the queues transactions?

                • 6. Re: How To set transactions not to time out?
                  Nicklas Karlsson Master

                  The people over at the hornetq-forum might have something to say about the classcastexception.