[jboss-user] [JBoss Seam] - Re: EntityManager newibe Question

RobJellinghaus do-not-reply at jboss.com
Fri Aug 25 19:02:48 EDT 2006


@PersistenceContext won't work unless your class is @Stateful or @Stateless, AFAIK.

Why are you not using a Seam component rather than a POJO?  Seam's whole mission in life is managing your persistence context across multiple requests, conversations, sessions, etc.  In similar cases in my app, I have Seam components that inject the EntityManager, and then I explicitly pass it into any POJOs that need it.  This ensures I'm using the correctly scoped EntityManager for the current state of my Seam app.

Cheers,
Rob

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

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



More information about the jboss-user mailing list