Uploaded image for project: 'Seam 2'
  1. Seam 2
  2. JBSEAM-5001

Deadlock between SFSB EJB lock and Component.getInstanceFromFactory factoryLock calling factory from the same component

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: 2.3.0.BETA2
    • Fix Version/s: 2.3.1.CR1
    • Component/s: Core
    • Labels:
      None
    • Steps to Reproduce:
      Hide

      1. deploy the attached JBSEAM-5001.ear
      2. run the attached "test.py" in Python2

      Show
      1. deploy the attached JBSEAM-5001 .ear 2. run the attached "test.py" in Python2

      Description

      The following sample demonstrates a deadlock between SFSB lock and the Component.getInstanceFromFactory factoryLock:

      @Stateful
      @Scope(ScopeType.SESSION)
      @Name("test")
      public class TestAction implements Test
      {
         
         public String test() {
            Thread.sleep(500);
            Component.getInstance("testString", true);
            return "test";
         }
         
         @Factory(value="testString", scope=ScopeType.SESSION)
         public String getTestString() {
            return "testString";
         }
      
         @Remove
         public void remove() {}
      }
      

      when test.xhtml contains:

      <h:outputText value="#{test.test()} " />
      

      and othertest.xhtml contains:

      <h:outputText value="#{testString} " />
      

      If the othertest.seam is requested just after (<500ms after) the test.seam with the same session cookie.

      The problem seems to be that the #

      {test.test()}

      first locks the TestAction SFSB lock and then the Seam factory lock in the Component.getInstance call, while #

      {testString}

      locks the factoryLock first.

        Gliffy Diagrams

          Attachments

          1. JBSEAM-5001.ear
            1.62 MB
          2. JBSEAM-5001.tar.gz
            19 kB
          3. test.py
            1 kB

            Issue Links

              Activity

                People

                • Assignee:
                  manaRH Marek Novotny
                  Reporter:
                  maschmid Marek Schmidt
                • Votes:
                  1 Vote for this issue
                  Watchers:
                  4 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: