Issue Type: Bug Bug
Affects Versions: 2.3.0.BETA2
Assignee: Marek Novotny
Attachments: seam-registration.ear
Components: Core
Created: 18/Jun/12 11:05 AM
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() {
      System.out.println("XXX: TestProducer in 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.

Environment: JBoss AS 7.1.2.Final
Fix Versions: 2.3.0.CR1
Project: Seam 2
Priority: Critical Critical
Reporter: Marek Schmidt
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira