[jboss-user] [JBoss Seam] - Re: Getting LazyInitializationErrors with a SMPC
SmokingAPipe
do-not-reply at jboss.com
Wed Dec 27 00:59:16 EST 2006
"norman.richards at jboss.com" wrote : I assume the reason you were failing is that your PC was not in long-running conversation.
Right, that is the problem. I load the customer into the session-scope, and that works. Now I want to display some collections that are referenced by the customer object on some other pages. That won't work because there's no conversation and thus no conversation-scoped SMPC.
anonymous wrote : It's obviously not a bright idea to store a conversation-scoped entity in the session, but it would work.
Ok, then how do I handle this? I've got a Customer in the session, and now I need to start a conversation with the same customer entity in it.
I could have a conversation-scoped bean with some other field, like conversationCustomer. I could then do:
conversationCustomer = entityManager.merge(customer);
but that seems wrong because I'm not really doing a merge.
What do you think of this? Surely this is a fairly common situation, where there is a user object that's in a session, and then we need to have that user attached to a PC so we can display collections from that user? There must be some standard approach to this?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3996378#3996378
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3996378
More information about the jboss-user
mailing list