3 Replies Latest reply on Feb 13, 2004 4:04 AM by rafaborges

    ejb transaction timeout problem!

    bono

      hi,

      we have a jboss/tomcat web application. i'm using jboss 2.4.1.

      we have this operation which takes a lot of time to complete (more than 2 minutes) & cannot be completed because it times out. the operation is implemented in a method in a stateless session ejb. the ejb method is configured with required, container-managed transaction.

      below is the error from the jboss log:

      the strangest thing is that the timeout occurs after ~2 minutes, and the timeout for jboss transactions is set to 300 seconds.

      when i tried to reproduce the problem, i created a method that just "sleeps": it timed out in 300 seconds & jboss issued a message in the log but did not terminate the method.

      the operation that breaks is basically a loop generating invoices: for each invoice several web page requests need to be made to the internet which take a few seconds & that is why the process is so slow. it gets interrupted when a method call is performed to generate the next invoice.

      [BeanLock] Saw rolled back tx=TransactionImpl:XidImpl [FormatId=257, GlobalId=server1.pbagalleries.com//72587, BranchQual=]
      [LiveAuctionInvoicesEJB] TRANSACTION ROLLBACK EXCEPTION:Transaction marked for rollback, possibly a timeout; nested exception is:
      java.lang.RuntimeException: Transaction marked for rollback, possibly a timeout
      [LiveAuctionInvoicesEJB] java.lang.RuntimeException: Transaction marked for rollback, possibly a timeout
      [LiveAuctionInvoicesEJB] at org.jboss.ejb.plugins.lock.QueuedPessimisticEJBLock.doSchedule(QueuedPessimisticEJBLock.java:170)
      [LiveAuctionInvoicesEJB] at org.jboss.ejb.plugins.lock.QueuedPessimisticEJBLock.schedule(QueuedPessimisticEJBLock.java:143)
      [LiveAuctionInvoicesEJB] at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invokeHome(EntitySynchronizationInterceptor.java:247)
      [LiveAuctionInvoicesEJB] at org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInstanceInterceptor.java:154)
      [LiveAuctionInvoicesEJB] at org.jboss.ejb.plugins.TxInterceptorCMT.invokeNext(TxInterceptorCMT.java:135)
      [LiveAuctionInvoicesEJB] at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:307)
      [LiveAuctionInvoicesEJB] at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:86)
      [LiveAuctionInvoicesEJB] at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:103)
      [LiveAuctionInvoicesEJB] at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:106)
      [LiveAuctionInvoicesEJB] at org.jboss.ejb.EntityContainer.invokeHome(EntityContainer.java:420)
      [LiveAuctionInvoicesEJB] at org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker.invokeHome(JRMPContainerInvoker.java:437)
      [LiveAuctionInvoicesEJB] at org.jboss.ejb.plugins.jrmp.interfaces.HomeProxy.invokeHome(HomeProxy.java:237)
      [LiveAuctionInvoicesEJB] at org.jboss.ejb.plugins.jrmp.interfaces.HomeProxy.invoke(HomeProxy.java:182)
      [LiveAuctionInvoicesEJB] at $Proxy114.create(Unknown Source)
      [LiveAuctionInvoicesEJB] at admintool.ejb.stateless.InvoiceManagerEJBean.createInvoice(InvoiceManagerEJBean.java:1176)
      [LiveAuctionInvoicesEJB] at admintool.ejb.stateless.InvoiceManagerEJBean.bulkCreateInvoicesFor(InvoiceManagerEJBean.java:2939)
      [LiveAuctionInvoicesEJB] at java.lang.reflect.Method.invoke(Native Method)
      [LiveAuctionInvoicesEJB] at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:543)
      [LiveAuctionInvoicesEJB] at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:87)
      [LiveAuctionInvoicesEJB] at org.jboss.ejb.plugins.TxInterceptorCMT.invokeNext(TxInterceptorCMT.java:133)
      [LiveAuctionInvoicesEJB] at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:307)
      [LiveAuctionInvoicesEJB] at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:99)
      [LiveAuctionInvoicesEJB] at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:128)
      [LiveAuctionInvoicesEJB] at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:195)
      [LiveAuctionInvoicesEJB] at org.jboss.ejb.StatelessSessionContainer.invoke(StatelessSessionContainer.java:286)
      [LiveAuctionInvoicesEJB] at org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker.invoke(JRMPContainerInvoker.java:393)
      [LiveAuctionInvoicesEJB] at org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker.invoke(JRMPContainerInvoker.java:470)
      [LiveAuctionInvoicesEJB] at org.jboss.ejb.plugins.jrmp.interfaces.GenericProxy.invokeContainer(GenericProxy.java:335)
      [LiveAuctionInvoicesEJB] at org.jboss.ejb.plugins.jrmp.interfaces.StatelessSessionProxy.invoke(StatelessSessionProxy.java:123)
      [LiveAuctionInvoicesEJB] at $Proxy72.bulkCreateInvoicesFor(Unknown Source)
      [LiveAuctionInvoicesEJB] at _0002fbulkCreateInvoice_0002ejspbulkCreateInvoice_jsp_0._jspService(_0002fbulkCreateInvoice_0002ejspbulkCreateInvoice_jsp_0.java:1252)
      [LiveAuctionInvoicesEJB] at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
      [LiveAuctionInvoicesEJB] at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      [LiveAuctionInvoicesEJB] at org.apache.jasper.servlet.JspServlet$JspCountedServlet.service(JspServlet.java:130)
      [LiveAuctionInvoicesEJB] at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      [LiveAuctionInvoicesEJB] at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:282)
      [LiveAuctionInvoicesEJB] at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:429)
      [LiveAuctionInvoicesEJB] at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:500)
      [LiveAuctionInvoicesEJB] at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      [LiveAuctionInvoicesEJB] at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)
      [LiveAuctionInvoicesEJB] at org.apache.tomcat.core.Handler.service(Handler.java:287)
      [LiveAuctionInvoicesEJB] at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
      [LiveAuctionInvoicesEJB] at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:812)
      [LiveAuctionInvoicesEJB] at org.apache.tomcat.core.ContextManager.service(ContextManager.java:758)
      [LiveAuctionInvoicesEJB] at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:213)
      [LiveAuctionInvoicesEJB] at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
      [LiveAuctionInvoicesEJB] at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501)
      [LiveAuctionInvoicesEJB] at java.lang.Thread.run(Thread.java:484)

        • 1. Re: ejb transaction timeout problem!
          rafaborges

          I'm having exactly the same problem, using jboss-3.2.1_tomcat-4.1.24. Have anybody figured out ?

          • 2. Re: ejb transaction timeout problem!

            Figured what out, where to configure the transaction timeout?

            • 3. Re: ejb transaction timeout problem!
              rafaborges

              I try to invoke an operation to an EJB which takes 4 minutes aporx. This EJB is called from a Java class run inside JBoss as well. But the EJB call returns with an exception after 2 minutes.

              I don't think this issue is related to transaction timeout because when debuging I've realized that the transaction timeout raises after 5 minutes.

              The problem is that the EJB call always end after 2 minutes (not after 5) and I do not why.

              The same bono described.

              I use container transaction.

              Thanks indeed.