[jboss-user] [JBoss Seam] - Warning: do not use Seam managed pesistent context for BMT

koenhandekyn do-not-reply at jboss.com
Mon Oct 1 08:18:46 EDT 2007


warning !!!

just lost a lot of time with the following. When you want to do bean managed transactions, do NOT use a seam managed persistent context (injected with @In) but use a EJB3 container managed persistent context (injected with @PersistenceContext).

BMT how to summary

mark bean as BMT

  @TransactionManagement(TransactionManagementType.BEAN)

inject em

  @PersistenceContext
  // NOT !!! @In
  private EntityManager entityManager;

inject user transaction

  @Resource
  private UserTransaction userTransaction;

start / commit / rollback transaction on userTransaction object

      userTransaction.begin(); // etc

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

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



More information about the jboss-user mailing list