[seam-issues] [JBoss JIRA] Commented: (JBSEAM-4760) PassivatedEntity class only passivates entities belonging to first entity manager

Peter Brewer (JIRA) jira-events at lists.jboss.org
Fri Jan 7 05:45:18 EST 2011


    [ https://issues.jboss.org/browse/JBSEAM-4760?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12574046#comment-12574046 ] 

Peter Brewer commented on JBSEAM-4760:
--------------------------------------

@Merek: Thanks for checking the svn checkout - I should have said I'm using anonymous svn access as I don't yet have commit privileges. The checkout problem was with my local path, as soon as I changed that it worked!

> PassivatedEntity class only passivates entities belonging to first entity manager
> ---------------------------------------------------------------------------------
>
>                 Key: JBSEAM-4760
>                 URL: https://issues.jboss.org/browse/JBSEAM-4760
>             Project: Seam
>          Issue Type: Bug
>          Components: Core, Performance and Scalability
>    Affects Versions: 2.2.1.CR2
>         Environment: Seam 2.2.1.CR2, JBoss 5.1.0.GA, Windows 7, Java 1.6.0_22 (64-bit)
>            Reporter: Peter Brewer
>              Labels: patch
>         Attachments: PassivatedEntity.java.diff, PassivatedEntity.java.diff
>
>
> This bug only applies when all of the following apply:
> 1. You have more than one entity manager e.g. "myEntityManager1" and "myEntityManager2"
> 2. You have enabled the MEI (e.g. via the distributable="true" attribute on the init component in components xml)
> When performing fail-over from one node to another, the PassivatedEntity class should re-attached the the entity instance by cycling through each entity manager.
> Extract from PassivatedEntity.java
> 158:         for ( String persistenceContextName: PersistenceContexts.instance().getTouchedContexts() )
> 159:         {
> 160:            Object persistenceContext = Component.getInstance(persistenceContextName);
> 161:            return createPassivatedEntity(value, entityClass, persistenceContextName, persistenceContext);
> 162:         }
> However, this loop only examines the first touched PersistenceContext and ignores all others. I have submitted a patch that changes this to:
> 158:         for ( String persistenceContextName: PersistenceContexts.instance().getTouchedContexts() )
> 159:         {
> 160:            Object persistenceContext = Component.getInstance(persistenceContextName);
> 161:            PassivatedEntity passivatedEntity = createPassivatedEntity(value, entityClass, persistenceContextName, persistenceContext);
> 162:            if (passivatedEntity != null) {
> 163:              return passivatedEntity ;
> 164:            }
> 165:         }

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the seam-issues mailing list