Thanks for the excellent information and the informative links Matt!
anonymous wrote : It seems like you're embellishing Seam's behavior a little bit.
It's my understanding that when you begin a nested conversation, Seam doesn't take
a snapshot, it just creates a new empty "container", and prevents you from
storing new objects in the parent container....
|
| So, to get the behavior you're talking about, I think you'd need to manually
clone the person object when starting a nested conversation. The "original
state" Person would stay in the parent conversation, and the new cloned Person, which
might be edited, goes in the nested conversation.
You are absolutely correct Matt! I suppose I am embellishing Seam's behavior ;) I am
cloning the Person object when starting a nested conversation which would obviously be
problematic when using an SMPC since the instance would no longer be managed on cloning.
The reason the approach works is performing the merge at the end. The detached instance
is merged back with the attached "managed" instance. Thus, whichever instance
it finds first during the lookup (the clone in the nested conversation or the original in
the outer conversation) is the instance that is merged.
Thanks for increasing my understanding here on use of SMPCs with your information and the
provided links. The approach I've used works well for my client (who have many of
these mother-child scenarios and do not require an SMPC) but it is important to note that
this is not viable for managed entities.
One question. If I cloned my Person in the nested conversation and then merged the clone
to retrieve the attached instance, I'm assuming I would now have the same reference in
both my outer and inner conversation. Is this assumption correct? Thanks again.
By the way, on an unrelated note, how are you guys crediting quotes (e.g. "jacob
orshalick" wrote). I want to make sure I'm giving credit where credit is due :)
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4086097#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...