This content has been marked as final.
Show 6 replies
-
1. Re: Howto handle LazyInitializationException
jazir1979 May 24, 2007 6:03 AM (in response to thierry.rietsch)Hi Thierry,
Have you read about the extended persistence context?
If not, this is where your answer lies http://docs.jboss.com/seam/1.2.1.GA/reference/en/html/persistence.html
Using a conversation-scoped SFSB with an extended persistence context will solve your problem.
Daniel. -
2. Re: Howto handle LazyInitializationException
thierry.rietsch May 24, 2007 6:39 AM (in response to thierry.rietsch)Thank you for your reply. I have read through the articel in the JBoss Seam documentation. Unfortunately I din't fully understand it. Is there an example of an extended persistence context in the jboss-seam examples?
Thanks again for your reply and your help,
thierry -
3. Re: Howto handle LazyInitializationException
thierry.rietsch May 24, 2007 6:47 AM (in response to thierry.rietsch)Now I got it. Sorry. I use now:
class SoftwareObjectSearchBean { // other code @PersistenceContext(type=PersistenceContextType.EXTENDED) EntityManager em; // other code } Is that the right way?
-
4. Re: Howto handle LazyInitializationException
gavin.king May 24, 2007 9:45 AM (in response to thierry.rietsch)That is one way, but a better way is to use a Seam-managed PC.
-
5. Re: Howto handle LazyInitializationException
trickyvail May 24, 2007 10:50 AM (in response to thierry.rietsch)That is one way, but a better way is to use a Seam-managed PC.
The "Seam-managed Persistence Context (PC)" you refer to is an Extended Persistence Context that is stored inside a Seam Conversation Scope? -
6. Re: Howto handle LazyInitializationException
trickyvail May 24, 2007 11:12 AM (in response to thierry.rietsch)Seam managed persistence contexts are explained in the Seam documentation in section 8.3 page 107.