[seam-issues] [JBoss JIRA] (JBSEAM-4997) Deadlock with components using factories of each other

Marek Novotny (JIRA) jira-events at lists.jboss.org
Tue Aug 14 14:07:15 EDT 2012


     [ https://issues.jboss.org/browse/JBSEAM-4997?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Marek Novotny resolved JBSEAM-4997.
-----------------------------------

    Resolution: Done


enabled interleaving test and created locking on factoryMethod instead of factory
                
> Deadlock with components using factories of each other
> ------------------------------------------------------
>
>                 Key: JBSEAM-4997
>                 URL: https://issues.jboss.org/browse/JBSEAM-4997
>             Project: Seam 2
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.3.0.BETA2
>         Environment: Seam 2.3.0.CR1-SNAPSHOT r14979, AS 7.1.2.Final
>            Reporter: Marek Schmidt
>            Assignee: Marek Novotny
>             Fix For: 2.3.0.CR1
>
>
> The patch in JBSEAM-4861 introduced a potential deadlock with components using each other factories, such as in the following sample:
> {code}
> @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";
>    }
> }
> {code}
> 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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the seam-issues mailing list