title: Seam-managed transactions how-to
body: <p>Seam advises using an <strong>Extended</strong> persistent context in a <strong>Stateful</strong> Session Bean, in order to have Seam-managed persistence. </p>
  
  <p>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 <strong>Stateless</strong> EJB:</p>
  
  <pre><code>@Stateless
  @TransactionAttribute(TransactionAttributeType.REQUIRED)
  public class CrudServiceBean implements CrudService {
  
      @PersistenceContext(type = PersistenceContextType.TRANSACTION)
      private EntityManager em;
  ...
  }
  </code></pre>
  
  <p>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 <strong>by the container</strong> (WebLogic) and not Seam.</p>
  
  <p>However, we now need to satisfy the following scenario: We need to have a front-end Seam component (<strong>non-EJB</strong>) 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.</p>
  
  <p>Can we have Seam-managed transactions as in the scenario I described, without having a Seam-managed persistence context? Or are the two irrelevant?</p>