0 Replies Latest reply on Jul 15, 2010 10:14 AM by deadlock gr

    Seam-managed transactions how-to

    deadlock gr Newbie


      Seam advises using an Extended persistent context in a Stateful Session Bean, in order to have Seam-managed persistence.


      I am not clear on whether the above advice casts any implications on the way we want to have Seam-managed transactions. This is because our architecture is different. We have the following persistence context in a Stateless EJB:




      @Stateless
      @TransactionAttribute(TransactionAttributeType.REQUIRED)
      public class CrudServiceBean implements CrudService {
      
          @PersistenceContext(type = PersistenceContextType.TRANSACTION)
          private EntityManager em;
      ...
      }





      Our DAOs invoke the above CrudServiceBean are Stateless EJBs (some of them are also Seam components) with @TransactionAttribute(TransactionAttributeType.REQUIRED). So, our transactions are handled by the container (WebLogic) and not Seam.


      However, we now need to satisfy the following scenario: We need to have a front-end Seam component (non-EJB) invoke multiple DAO (EJB) methods and wrap all of them in a single transaction. If I understand correctly, we need to have Seam-managed transactions.


      Can we have Seam-managed transactions as in the scenario I described, without having a Seam-managed persistence context? Or are the two irrelevant?