[jboss-user] [JBoss Seam] - Re: When to use @PersistenceContext vrs @In EntityManager (S

msystems do-not-reply at jboss.com
Thu Feb 7 02:15:30 EST 2008


Use @PersistenceContext if you are using EJB3 and if you need a new transaction (@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW) ) - Seam ref:

anonymous wrote : 
  | If you are using EJB3 and mark your class or method @TransactionAttribute(REQUIRES_NEW) then the trans- 
  | action and persistence context shouldn't be propagated to method calls on this object. However as the Seam- 
  | managed persistence context is propagated to any component within the conversation, it will be propagated to 
  | methods marked REQUIRES_NEW. Therefore, if you mark a method REQUIRES_NEW then you should access the en- 
  | tity manager using @PersistenceContext. 
  | 

otherwise use SMPC.


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

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



More information about the jboss-user mailing list