-
1. Re: EntityHome persist problem
codelion Feb 16, 2007 10:38 AM (in response to dustismo)While I didn't look close enough to determine whether there are other problems, from my own experience I know sooner or later you could run into a problem with that factory being invoked only once in a conversation, and hence your factory made instance not being the same as the one home uses.
Hence, while you still may be having another problem, one first change I'd make is to forget about that advice in the reference manual to use the shorter syntax with a factory made instance, and rather thanvalue="#{uGroup.name}" value="#{uGroup.ugrouptype}" ...
instead use the longer but always correct syntaxvalue="#{groupHome.instance.name}" value="#{groupHome.instance.ugrouptype}" ...
Then go find your remaining problems, if any. -
2. Re: EntityHome persist problem
pmuir Feb 16, 2007 10:53 AM (in response to dustismo)Put a h:message component on the selectOneListbox (or better still keep a h:messages component running for the whole page during devel) and check what validation/update/conversion errors you are getting.
And I've never had a problem with the style the ref manual recommends for EntityHome's and factories -
3. Re: EntityHome persist problem
dustismo Feb 16, 2007 11:26 AM (in response to dustismo)Great advice thanks
The error I am getting is:Invalid selection. Selected item cannot be loaded from persistence context
What is the prefered way to keep the select items in the same persistence context as the EntityHome? In the entityconverter example I can't see where
clientTypes.resultList comes from.. ?
thanks
Dustin -
4. Re: EntityHome persist problem
pmuir Feb 16, 2007 12:28 PM (in response to dustismo)1) Make sure you are in a conversation
2) components.xml IIRC
but that error is more serious and means the entityconverter hasn't been able do its job. Make sure you are using 1.1.6 not 1.1.5. Are you getting that error when you don't select an option? -
5. Re: EntityHome persist problem
dustismo Feb 16, 2007 2:31 PM (in response to dustismo)Thanks for the tips.
I am using 1.1.6 and I don't get that error when nothing is selected. Any other suggestions on how to debug this? Oh, and I am using Icefaces 1.5.3..
thanks much,
Dustin -
6. Re: EntityHome persist problem
codelion Feb 16, 2007 3:21 PM (in response to dustismo)Pete,
To get the problem I saw you need to do this as I got to do when I started from a seam-generated project a couple weeks ago (things changed in seam-gen since, I think now there is join instead of begin):
From a list view (with query) go to create new entity page with a propagation begin, then with a link that doesn't end the conversation (someone else on the project put a tree of top level commands into a div for all pages) go somewhere else, soon through links come to the list again (but not "back", just following links as usual), at which time you still have the same conversation that "began", go to create new entity page (with same propagation begin), and you have a problem. For the heck of it put the id of the factory made instance up next to the id of the home.instance and they were different! I saw it. I repeated it. Why a new home? I'm not sure. But why not a new factory made instance? I guess the one from when the conversation began last time here still was around, so no call to factory method.
My solution was twofold:
1) I stopped using the factory made instance.
2) I for now don't go there with a propagation begin. I'm still trying to get a full understanding of what I'll want to do with conversations. Let's say I'm in a conversation to do something, what are all the possible ways out, and how to I get 100% certainty of behavior at all possible exits. That should include a team member putting "any kind of non-seam aware link" into a part of the page that I just include, or "almost any kind of link".
I've mentioned this before in http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4010984 -
7. Re: EntityHome persist problem
codelion Feb 16, 2007 3:29 PM (in response to dustismo)Not sure about all the details now, but the problem was real. I clearly had it display in the view fields from the factory made instance and from the home.instance, and they were two separate instances. I showed the screen to a colleague. Since I've stopped using the factory made instance I don't have that kind of problem any more. And it probably was made more frequent of a problem because of use of propagation begin without matching end.