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

Deadlock between SFSB EJB lock and Component.getInstanceFromFactory factoryLock

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Partially Completed
    • Affects Version/s: 2.3.0.BETA2
    • Fix Version/s: 2.3.0.CR1
    • Component/s: Core
    • Labels:
      None

      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("foo", true);
            return "test";
         }
         
         @Factory(value="testString", scope=ScopeType.EVENT)
         public String getTestString() {
            return "testString";
         }
      
         @Remove
         public void remove() {}
      }
      
      @Name("testProducer")
      public class TestProducer {
         @Factory(scope=ScopeType.EVENT)
         public String getFoo() {
            return "foo";
         }
      }
      

      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 factoryLock in the Component.getInstance call, while #

      {testString}

      locks the factoryLock first.

        Gliffy Diagrams

          Attachments

          1. JBSEAM-4993.tar.gz
            62 kB
          2. jstack.txt
            41 kB
          3. registration.tar.bz2
            10 kB
          4. seam-registration.ear
            1.62 MB
          5. seam-registration.ear
            1.62 MB
          6. server.log.bz2
            321 kB
          7. test.py
            2 kB
          8. test.py
            2 kB

            Issue Links

              Activity

                People

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

                  Dates

                  • Created:
                    Updated:
                    Resolved: