[jboss-jira] [JBoss JIRA] (AS7-2076) activation/passivation of extended persistence context

Scott Marlow (Commented) (JIRA) jira-events at lists.jboss.org
Thu Oct 13 23:34:15 EDT 2011


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

Scott Marlow commented on AS7-2076:
-----------------------------------

Since this issue is related to clustering/replication of the extended persistence context, I'm entering some notes on that here.  For clustering support, I'm thinking of including the SFSBXPCMap related data, in the ExtendedEntityManager serialization payload.

This would be controlled by a JPA hook (SPI) that clustering could call into on the thread performing the serialization.  This might use a ThreadLocal, so a call before/after serialization would be expected.  This might be used for optimizing the payload size as well (for the case when multiple SFSBs reference the same XPC mentioned here http://community.jboss.org/docs/DOC-13822).

It might be easier to transfer the SFSBXPCMap data if we use a UUID to identify the XPC instance.  The organization would probably change from:

    private ConcurrentHashMap<SFSBContextHandle, List<EntityManager>> contextToXPCMap =
        new ConcurrentHashMap<SFSBContextHandle, List<EntityManager>>();

    private ConcurrentHashMap<EntityManager, List<SFSBContextHandle>> XPCToContextMap =
        new ConcurrentHashMap<EntityManager, List<SFSBContextHandle>>();

To:

    private ConcurrentHashMap<SFSBContextHandle, List<EntityManagerUUID>> contextToXPCMap =
        new ConcurrentHashMap<SFSBContextHandle, List<EntityManagerUUID>>();

    private ConcurrentHashMap<EntityManagerUUID, List<SFSBContextHandle>> XPCToContextMap =
        new ConcurrentHashMap<EntityManagerUUID, List<SFSBContextHandle>>();

A UUID to EntityManager Map will be needed as well (and kept up to date after replication, XPC creation/destroy).

This impacts how we do passivation/activation...
                
> activation/passivation of extended persistence context
> ------------------------------------------------------
>
>                 Key: AS7-2076
>                 URL: https://issues.jboss.org/browse/AS7-2076
>             Project: Application Server 7
>          Issue Type: Task
>          Components: JPA / Hibernate
>    Affects Versions: 7.1.0.Alpha1
>            Reporter: Scott Marlow
>            Assignee: Scott Marlow
>             Fix For: 7.1.0.Beta1
>
>
> Currently, SFSBXPCMap directly references ExtendedEntityManager.  ExtendedEntityManager implements the extended persistence context (contains a direct reference of the underlying persistence context.
> To support activation/passivation.  SFSBXPCMap should instead reference the XPC via an uuid (or something like that), that can be used to get the XPC (if SFSB is in activated state).
> Note EJB 3.1 specification section 4.2.1 titled Instance Passivation and Conversational State:
> "
> A container must not passivate a stateful session bean with an extended persistence context unless the
> following conditions are met:[9]
>  * All the entities in the persistence context are serializable.
>  * The EntityManager is serializable.
> [9] The container is not permitted to destroy a stateful session bean instance because it does not meet these requirements.
> "

--
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 jboss-jira mailing list