The patch introduces a potential deadlock with components using each other factories, such as in the following sample:

@Scope(ScopeType.APPLICATION)
   @Name("factoryLock.knitFactory")
   public static class KnitFactory
   {
      @Factory(value="factoryLock.knitPurl", scope=ScopeType.SESSION)
      public String getDoubleKnit() {
         return "knit(" + (String)Component.getInstance("factoryLock.purl") + ")";
      }
      
      @Factory(value="factoryLock.knit", scope=ScopeType.SESSION)
      public String getKnit() {
         return "knit";
      }
   }
   
   @Scope(ScopeType.APPLICATION)
   @Name("factoryLock.purlFactory")
   public static class PurlFactory
   {
      @Factory(value="factoryLock.purlKnit", scope=ScopeType.SESSION)
      public String getDoublePurl() {
         return "purl(" + (String)Component.getInstance("factoryLock.knit") + ")";
      }
      
      @Factory(value="factoryLock.purl", scope=ScopeType.SESSION)
      public String getPurl() {
         return "purl";
      }
   }

this may cause a deadlock if two different requests in the same session ask for #{factoryLock.knitPurl} and #{factoryLock.purlKnit} respectively.

The problem is that different threads may lock the components in different order.

Change By: Marek Schmidt (03/Jul/12 7:39 AM)
Resolution: Done
Status: Resolved Reopened
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