[jboss-user] [JBoss Seam] - Re: @In or @PersistenceContext for EntityManager?

christian.bauer@jboss.com do-not-reply at jboss.com
Mon Apr 9 07:30:34 EDT 2007


"Kruno" wrote : On the other hand if you use @PersistenceContext than it is EJB stuff and and EntityManager is unique for on ActionBean only. 

That is not entirely correct. A Seam-managed persistence context is handled by Seam in the sense that its beginning and end is automatically the same as the "current" conversation (either a temporary conversation or a long-running conversation that spans several requests). This is very convenient. 

The EJB-container managed persistence context is on the other hand bound to the lifecycle of its owner, a stateful session bean. It's also only injected into components that are called within the same transaction context. The Seam-managed persistence context is injected into whatever components are called in the current conversation, no matter if there is a transaction going on or not.

This has been discussed several times on the forum already, just search for it.


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

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



More information about the jboss-user mailing list