[jboss-user] [JBoss Seam] - ManagedPersistenceContext in Manning JPA book

asookazian do-not-reply at jboss.com
Fri Nov 9 00:45:54 EST 2007


The last chapter on Seam in the JPA with Hibernate book was very informative.  I stumbled upon the section on triggering a LazyInitializationException when trying to root-cause analyze a colleague's LazyInitializationException problem.

So it turns out that you can fix this problem by extending the persistence context as follows in your SFSB:

@PersistenceContext(type=EXTENDED)
  | private EntityManager em;

When I search for keyword "ManagedPersistenceContext" in all of the Seam example apps in the CR2 distro, I got no hits.  Does that mean it's not necessary to use the Seam managed context and the TransactionalSeamPhaseListener to solve LazyInitializationException's?

When do you need to integrate the Seam-managed persistence context as explained in pages 814-815 of the book?  I guess I'm not understanding exactly the added value of using the Seam-managed persistence context versus javax.persistence.PersistenceContext.

I see more methods in the API for the Seam-managed persistence context class...

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4103161#4103161

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4103161



More information about the jboss-user mailing list