[jboss-dev-forums] [Design of EJB 3.0] - Re: Issues with passivation of nested SFSBs

bstansberry@jboss.com do-not-reply at jboss.com
Mon Jan 29 17:07:42 EST 2007


"bill.burke at jboss.com" wrote : Brian....so, if we attach the lifecycle of the child nested bean to that of its parent, will there be no problems?

I believe the initial problem that led to this thread (orphaned ProxiedStatefulBeanContext left in cache) was a bug in StatefulTreeCache that can be easily fixed (StatefulTreeCache.remove() wasn't calling Pool.remove() when it should, preventing cleanup of the nested beans.)

The issue of when to replicate still remains. If we follow Carlo's example where a ref to the nested bean is handed to another in-VM client, if that client causes replication, only the proxy is replicated.  If instead, the cache finds the  ultimate parent bean and replicates that, then there is the potential problem of the parent getting replicated multiple times as it invokes methods on its children.

OK - I see the solution to that. Put a ThreadLocalStack in StatefulReplicationInterceptor; push and pop as the invocation proceeds; on the return side only replicate when the stack is empty.  Similar to what the web session repl code does with cross-context requests.

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

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



More information about the jboss-dev-forums mailing list