[jbossseam-issues] [JBoss JIRA] Commented: (JBSEAM-3188) ConcurrentModificationException on flush of ServerConversationContext

Jacob Orshalick (JIRA) jira-events at lists.jboss.org
Thu Sep 18 20:34:31 EDT 2008


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

Jacob Orshalick commented on JBSEAM-3188:
-----------------------------------------

In converting one of the book examples to Seam 2.1 Michael and I ran into this as well.  It seems to stem from the passivate(attribute) call added by :  JBSEAM-3078

>From testing, it seems that as a side-effect of the call added to passivate Wrapper instances, an invocation of:  PersistenceContexts.instance() occurs in the PassivatedEntity.passivateEntity(Object) method.  If the PersistenceContexts instance does not yet exist in the ConversationContext, an instance is created and added to the ConversationContext.additions attribute resulting in the ConcurrentModificationException (as in the outer loop we are iterating the additions Entry Set).

> ConcurrentModificationException on flush of ServerConversationContext
> ---------------------------------------------------------------------
>
>                 Key: JBSEAM-3188
>                 URL: https://jira.jboss.org/jira/browse/JBSEAM-3188
>             Project: Seam
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.0.3.CR1
>         Environment: 2.0.3.CR1, JBoss 4.2.2, JDK 5
>            Reporter: Sanne Grinovero
>         Attachments: JBSEAM-3188.patch
>
>
> As confirmed by other people on the forum at http://seamframework.org/Community/ConcurrentModificationExceptionAfterProgrammaticLogin
> It is possible for ServerConversationContext to iterate on an EntrySet which is modified in the iteration block.
> I couldn't understand exactly in which scenarios it happens, but it's easy to patch the code
> to iterate on a copy instead (I'll attach the patch).
> I can't say if it's correct to make a copy, or if you should actually avoid the changes.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the seam-issues mailing list