5 Replies Latest reply on Nov 12, 2009 6:52 PM by nbelaevski

    Transaction Timeout Issue

      We have recently upgraded from Richfaces 3.2.2 to 3.3.1. Post this upgrade, we are encountering a transaction timeout scenario, when an upload exceeds the default transaction timeout setting in Jboss (15 minutes).

      Our sequence of events:

      ... upload a file, call a session ejb to persist the file's meta data. The session ejb method is annotated with:

      @TransactionAttribute(TransactionAttributeType.REQUIRED)

      When a lager file is uploaded (takes more than 15 minutes to upload) the following error is encountered:

      "EntityManager must be access within a transaction"

      Now this error condition is encountered when using the Flash component and the non Flash component. However, it is not encountered in the previous version we had been using. In fact, 3.2.2 allows file uploads to extend past our 30 minute session timeout. The file is uploaded and Meta data persisted without issue.

      I suspect that the newer release is not freshening the session during the upload, but not certain this is the case.

      Is this a known issue?

      Recommendations for addressing?


        • 1. Re: Transaction Timeout Issue

          That should have been 5 minutes. My mistake. Any file uploads that take longer than 5 minutes encounter this issue

          • 2. Re: Transaction Timeout Issue

            A little more investigation ... if the default JTA transactiontimeout is set to 1800 (30 minutes) from the default 300 (5 minutes), the larger file uploads succeed and post upload processing is successful.

            It appears that a root transaction managed in the web layer is timing out, based on this JTA setting. I set the default JAT transactiontimeout back to 300 and removed all of our access to transactional EJB calls executed during post upload processing. Now the error is cropping up in the Web layer (again, this occurs when file upload duration exceeds the JTA timeout value):



            Nov-11 18:12:50,808 DEBUG [ajp-jbossdev5.namerica.idexxi.com%2F172.31.29.160-8309-9] [org.ajax4jsf.event.AjaxPhaseListener] Process after phase UPDATE_MODEL_VALUES 4
            Nov-11 18:12:50,808 DEBUG [ajp-jbossdev5.namerica.idexxi.com%2F172.31.29.160-8309-9] [javax.enterprise.resource.webcontainer.jsf.timing] [TIMING] - [47ms] : Execution time for phase (including any PhaseListeners) -> UPDATE_MODEL_VALUES 4
            Nov-11 18:12:50,808 DEBUG [ajp-jbossdev5.namerica.idexxi.com%2F172.31.29.160-8309-9] [org.ajax4jsf.event.AjaxPhaseListener] Process before phase INVOKE_APPLICATION 5
            Nov-11 18:12:50,808 DEBUG [ajp-jbossdev5.namerica.idexxi.com%2F172.31.29.160-8309-9] [javax.enterprise.resource.webcontainer.jsf.lifecycle] Entering InvokeApplicationsPhase
            Nov-11 18:12:50,808 DEBUG [ajp-jbossdev5.namerica.idexxi.com%2F172.31.29.160-8309-9] [javax.enterprise.resource.webcontainer.jsf.lifecycle] Exiting InvokeApplicationsPhase
            Nov-11 18:12:50,808 DEBUG [ajp-jbossdev5.namerica.idexxi.com%2F172.31.29.160-8309-9] [org.ajax4jsf.event.AjaxPhaseListener] Process after phase INVOKE_APPLICATION 5
            Nov-11 18:12:50,810 WARN [ajp-jbossdev5.namerica.idexxi.com%2F172.31.29.160-8309-9] [com.arjuna.ats.arjuna.logging.arjLoggerI18N] [com.arjuna.ats.arjuna.coordinator.BasicAction_40] - Abort called on already aborted atomic action -53e0e260:84df:4afb2c53:26cc
            Nov-11 18:12:50,810 WARN [ajp-jbossdev5.namerica.idexxi.com%2F172.31.29.160-8309-9] [org.jboss.seam.jsf.SeamPhaseListener] uncaught exception, passing to exception handler
            java.lang.IllegalStateException: Could not commit transaction
            at org.jboss.seam.jsf.SeamPhaseListener.commitOrRollback(SeamPhaseListener.java:626)
            at org.jboss.seam.jsf.SeamPhaseListener.commitOrRollback(SeamPhaseListener.java:605)
            at org.jboss.seam.jsf.SeamPhaseListener.handleTransactionsAfterPhase(SeamPhaseListener.java:343)
            at org.jboss.seam.jsf.SeamPhaseListener.afterServletPhase(SeamPhaseListener.java:243)
            at org.jboss.seam.jsf.SeamPhaseListener.afterPhase(SeamPhaseListener.java:194)
            at com.sun.faces.lifecycle.Phase.handleAfterPhase(Phase.java:175)
            at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:114)
            at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
            at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
            --

            • 3. Re: Transaction Timeout Issue
              nbelaevski

              Hello,

              Thank you for reporting this! I've created JIRA issue: https://jira.jboss.org/jira/browse/RF-8135.

              • 4. Re: Transaction Timeout Issue

                I am pawing through the Richfaces source code now. Can you expedite my search for where a fix is needed? I'd like to write a fix and compile for our needs. I could contriubte this.

                • 5. Re: Transaction Timeout Issue
                  nbelaevski

                  Please take a look at the following:

                  http://anonsvn.jboss.org/repos/richfaces/branches/community/3.3.X/ui/fileUpload/src/main/java/org/richfaces/component/FileUploadPhaselistener.java

                  and

                  http://anonsvn.jboss.org/repos/seam/trunk/src/main/java/org/jboss/seam/jsf/SeamPhaseListener.java.

                  Previously parsing MultipartRequest was invoked from filter, currently its parsing is triggered by phase listener, so I guess the reason for timeout is that parsing is happening in the scope of active transaction, thus causing problems for slow connections.