[jboss-user] [JBoss Seam] - Re: When to use @PersistenceContext vrs @In EntityManager (S
christian.bauer@jboss.com
do-not-reply at jboss.com
Thu Feb 7 14:21:19 EST 2008
Folks, it's quite simple:
- EJB 3.0 defines injection rules for EntityManager with @PersistenceContext
- For consistency reasons with the rest of the component model, they decided to make the _propagation_ rules (one component that has @PersistenceContext calling another component that also has @PersistenceContext) bound to transaction OR instantiation order propagation (SLSB vs. SFSB)
- These rules are straightforward (although I think our book is the only one that documents them properly) but complex
- Seam-managed and injected persistence contexts are an alternative with easier injection and propagation rules, not bound to transaction or instantiation order
So, unless you WANT PC propagation rules bound to transaction propagation (that's what the quoted paragraph from the docs is about), using a SMPC is fine in all situations.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4127548#4127548
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4127548
More information about the jboss-user
mailing list