-
1. Re: Concerning nested conversation
gavin.king Nov 21, 2006 12:03 PM (in response to antispart)Does calling an @End annotated method on an outer conversation guarantee that all nested conversations will be killed?
Yes. -
2. Re: Concerning nested conversation
gavin.king Nov 21, 2006 12:05 PM (in response to antispart)1.1.0 CR1 solved some issues I was having with this
There was a bug in previous versions that meant that if you encountered @Begin(join=true) after @End, the nested conversation stayed alive.
http://jira.jboss.com/jira/browse/JBSEAM-511 -
3. Re: Concerning nested conversation
gavin.king Nov 21, 2006 12:08 PM (in response to antispart)BTW, the debug page will show you exactly what long-running conversations exist.
-
4. Re: Concerning nested conversation
antispart Nov 21, 2006 12:31 PM (in response to antispart)It looks like what's happening is that when an @End annotated method is encountered the deepest level (most nested) conversation gets killed, not necessarily the one started on the same SFSB.
So if I havepublic class A { @Begin (nested=true) selectA() @End deselectA() }
public class B { @Begin (nested=true) selectB() @End() deselectB }
public class C { @Begin (nested=true) selectC @End deselectC}
And I call
selectA()
selectB()
selectC()
deselectB()
Only the last conversation is being killed (the one started in selectC().
Is there any way to specify that you want to kill the conversation started on the same SFSB (and therefore all nested conversation as well)? So, deselectB would kill the conversations started by selectB and selectC. Also, deselectA would kill the conversations started by selectA, selectB, selectC.
The alternative is just to call deselectC from deselectB, but I think it'd be more clean for that to be handled transparently.
Thanks. -
5. Re: Concerning nested conversation
gavin.king Nov 21, 2006 1:01 PM (in response to antispart)Correct. @End ends the *current* (ie most nested conversation). Conversations are not tied to an instance of a Seam component.
-
6. Re: Concerning nested conversation
antispart Nov 21, 2006 3:17 PM (in response to antispart)Thanks very much. It does make more sense this way actually =-).
-
7. Re: Concerning nested conversation
antispart Nov 21, 2006 3:44 PM (in response to antispart)Going back to my previous example:
@End deselectA() { deselectB(); } @End deselectB() { ... }
It seems that calling deselectA() will only kill the nested most conversation, but when it then calls deselectB() the 2nd conversation is not killed (even though the method is annotated with @End.
Is this a bug, or is there another way to kill the 2nd conversation? -
8. Re: Concerning nested conversation
antispart Nov 21, 2006 4:03 PM (in response to antispart)Took a look at the API and found:
Conversation.instance().pop();
Still, it'd be nice if the @End annotation could take care of this. In my case I removed the @End annotation and am using pop() instead - so far the behavior looks good, but I'm not sure that this is the preferred pattern?