[jboss-user] [JBoss Seam] - ManagedEntityIdentityInterceptor and Stateful Session Beans

wschwendt do-not-reply at jboss.com
Sat Sep 15 11:28:51 EDT 2007

Can anyone enlighten me why  the ManagedEntityIdentityInterceptor  is only added to a Seam component when the scope of the component is CONVERSATION?   (-> org.jboss.seam.Component.initDefaultInterceptors() )

My understanding of the ManagedEntityIdentityInterceptor (which could be wrong)  is that it serves to ensure that Entities referenced by a stateful component such as a stateful session bean (SFSB) maintain their object identity within the JVM even across passivations and reactivations of this stateful component.  

Let's assume that we have a stateful session bean (SFSB) referencing an Entity instance, and the the scope of the SFSB is EVENT_Scope.   Since the scope is EVENT Scope and not CONVERSATION scope, no  ManagedEntityIdentityInterceptor is added to this SFSB.

Let's imagine further a situation where this SFSB is called multiple times during the life time of the EVENT scope.  For example, the SFSB could serve as backing bean for multiple JSF view components and be called multiple times during the render response JSF phase.

This raises the question: Can it happen that the EJB container passivates and then reactivates this SFSB between the different calls to this SFSB?  (I'd assume yes, but could be wrong).

If I'm not wrong with my "yes"-assumption, don't we need the  ManagedEntityIdentityInterceptor added to this event-scoped SFSB component to maintain the object identity of any Entity instances referenced by the SFSB?

Thanks in advance for any answers.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4084750#4084750

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4084750

More information about the jboss-user mailing list