1 Reply Latest reply on Apr 2, 2013 2:03 AM by Nicklas Karlsson

    weld-000315-failed-to-acquire-conversation-lock

    Jody Schering Newbie

      I'm creating a JSF 2 application using PrimeFaces 3.4.2 and CDI on JBoss EAP 6. The application has a section that uses a long running conversation for 3 pages. When the user navigates to the first page that uses the conversation they have 2 links to the other pages.

       

       

          <p:commandLink action="#{event.navigateToIfg()}" >

              <h:outputText value="#{msg.ifg_label}" />     

          </p:commandLink>

          <p:commandLink action="#{event.navigateToJob()}" >  

                  <h:outputText value="#{msg.job_label}"/>       

          </p:commandLink>

       

      Both methods use navigation rules to move between the pages.

         

      navigateToIfg() uses rule:

         

       

          <navigation-rule>

              <from-view-id>/event/event.xhtml</from-view-id>

                  <navigation-case>

                      <from-outcome>TO_IFG</from-outcome>

                      <to-view-id>/event/eventGuideIfg.xhtml?cid=#  {javax.enterprise.context.conversation.id}</to-view-id>

                      <redirect />

                  </navigation-case>

          </navigation-rule>

         

      navigateToJob() uses rule:

       

          <navigation-rule>

              <from-view-id>/event/event.xhtml</from-view-id>

              <navigation-case>

                  <from-outcome>TO_JOB</from-outcome>

                  <to-view-id>/event/eventGuideJob.xhtml?cid=#{javax.enterprise.context.conversation.id}</to-view-id>

                  <redirect />

              </navigation-case>

          </navigation-rule>      

         

      The application also has a global on click javascript listener that triggers a p:remoteCommand notifying a sessionscoped bean of the click. So when a user tries to navigate to IFG or to JOB the following is triggered as well.

       

          <p:remoteCommand id="keepAliveRemoteCommand" name="keepAliveRC" actionListener="#{sessionInfo.keepAlive()}" autoRun="false" update="@none" process="@this" />

            

       

      I believe the navigation and the click listener firing close together causes me to get the warning: "WELD-000315 Failed to acquire conversation lock in 1,000 for Conversation with id: 1" which then causes other exceptions and failures in my application. Lastly, the issue is not always consistent, sometimes it will happen immediately other times it won't happen using the same steps. I need to understand what I'm doing wrong and how I can fix this issue.