Can we solve the XPC issue with something along these lines?
1) XPC is stored in the parent bean context.
2) Child beans have an independent lifecycle (i.e. bean instance is cached with the
context, not in an internal data structure of the parent. Child bean context stores data
about location of parent, and vice versa.
3) When nested bean is invoked, interceptor accesses the parent bean, gets the XPC and
injects it into the nested bean instance. On the way out clear the XPC ref from the
nested bean. I.e. don't try to maintain a shared ref to XPC across serialization;
instead cache it in the parent and inject it into the child as needed.
4) As part of remove process, check if the bean is a parent. If so, check if any children
are still alive. If yes, don't remove context from the cache; instead set a removed
flag in the context. If removed flag is set an interceptor will not allow any call to the
context (throw NoSuchEjbException). But the context is still cached, so child beans can
find the XPC.
5) As part of remove process, check if bean is a child. If so, have parent re-check if
all its children are still alive. If not, parent context can be removed.
Along with this, in general it would be good to have a background thread that runs to
check for and remove orphaned beans. But that's true regardless of the value of the
above.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4008363#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...