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.
The patch introduces a potential deadlock with components using each other factories, such as in the following sample:
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.