-
1. Re: List re-initialization after nested conversation
jacob.orshalick Sep 27, 2007 7:40 PM (in response to beligum)Please post your code. When a conversation is nested, contextual variables in the parent conversation are read-only. This means that if you do something like:
@In(value="myList") @Out(value="myList") private List myList; ... @Begin public void beginParentConversation { myList = new ArrayList(); myList.add(something); } ... @Begin(nested=true) public void withinNestedConversation() { myList = new ArrayList(); myList.add(somethingElse); } ... @End public void endNestedConversation() { }
When endNestedConversation() is called the original list containing "something" will be reverted to. The list containing "somethingElse" is gone. -
2. Re: List re-initialization after nested conversation
beligum Sep 27, 2007 8:03 PM (in response to beligum)Hi Jacob,
(not at home right now, don't have the code at hand, but coming up)
that's exactly what I'm doing, except for the@Begin(nested=true) public void withinNestedConversation() { myList = new ArrayList(); myList.add(somethingElse); }
I don't really touch myList in this method, only 'somethingElse'.
It gets updated with new values, persisted to the db and refreshed. -
3. Re: List re-initialization after nested conversation
jacob.orshalick Sep 27, 2007 8:11 PM (in response to beligum)Alright, it will be much easier to discuss once you post the code. I will keep an eye out for your post.
-
4. Re: List re-initialization after nested conversation
nagypalg Oct 9, 2007 3:44 AM (in response to beligum)I had the same problem with Seam 2 CR1. It seems that it disappeared with Seam 2 CR2, and the list is not corrupted any more after returning from a nested conversation.
-
5. Re: List re-initialization after nested conversation
beligum Oct 9, 2007 5:28 AM (in response to beligum)oh great, I totally lost track of this post!
Nice to hear it's resolved (created a workaround instead of solving it).
thx -
6. Re: List re-initialization after nested conversation
nagypalg Oct 9, 2007 7:03 AM (in response to beligum)Ups, sorry, I posted too fast. I also created a workaround, and did not completely removed it, that's why I thought the issue was solved. Unfortunatelly, it still isn't.
Anyway, my list comes from Hibernate, perhaps that is the problem?
I do not do anything with the list in the nested conversation, I do not even read it. So it cannot be the problem. -
7. Re: List re-initialization after nested conversation
nagypalg Oct 10, 2007 4:57 AM (in response to beligum)Further tests show that the problem does not appear when the bean that starts the nested conversation is in the session scope. The problem occurs only when the bean is in the conversation scope.
-
8. Re: List re-initialization after nested conversation
beligum Oct 10, 2007 5:50 AM (in response to beligum)Just a thought: could it be that the list isn't passivated in session scope?
Had some problems with passivating lists in the past... -
9. Re: List re-initialization after nested conversation
pmuir Oct 10, 2007 8:50 AM (in response to beligum)If you can put together a simple test case please create a jira issue and attach it.
-
10. Re: List re-initialization after nested conversation
nagypalg Oct 12, 2007 12:08 PM (in response to beligum)Well, I made a simple web-application (three beans, three pages, plus a simple HSQL DB) that shows the problem. With all the libs, however, it is 10MB (Seam required quite a lot of libs :) ). Would it be OK to put it to the JIRA? Or should I put it without the libs?
-
11. Re: List re-initialization after nested conversation
pmuir Oct 12, 2007 6:41 PM (in response to beligum)This is against CR2 or CVS? In that case attach it without the libs and we'll add the libraries - or if it's from seam-gen, even better!
-
12. Re: List re-initialization after nested conversation
nagypalg Oct 15, 2007 4:53 AM (in response to beligum)Here you are:
http://jira.jboss.org/jira/browse/JBSEAM-2106
Actually I also tried to make a unit test (using SeamTest) that shows the problem, by I did not manage. Somehow getValue('#{masterAction}') gives back different instances of MasterAction in the unit test, but the same instance in the real application (the latter is expected). -
13. Re: List re-initialization after nested conversation
nagypalg Oct 15, 2007 4:55 AM (in response to beligum)I forgot to answer the library question: it is Seam CR2, plus the cglib library coming from the hibernate2 example.
In my real application I use hibernate 3.2.5.GA + Oracle 10g, but the same problem appears. -
14. Re: List re-initialization after nested conversation
nagypalg Oct 15, 2007 6:03 AM (in response to beligum)Anyway, I just noticed that the problem appears only when the Hibernate entities do not have a version attribute. (annotated with @Version) I hope it helps to find the cause of the problem.