2 Replies Latest reply on Dec 3, 2007 6:05 PM by Avi Segev

    Seam-managed persistence context Versus EJB3 persistence con

    Avi Segev Newbie

      We are conducting a “spike� on Seam 2.0.0.GA (JBoss, Richfaces and hibernate) for a new project.
      We decided to use the Seam-managed persistence context (instead of the EJB3 extended PersistenceContext) for the following reasons:
      The flexibility to inject the context to DAO components (which are not session beans)
      Recommendations in the Seam reference manual 8.3.

      We discovered that for a stateful session beans configured with a scope of “SESSION� the switch from EJB3 extended context (PersistenceContext(type=EXTENDED) to seam injected context @In(value ="entityManager") , we need to define the scope of the injected entity manager to “SESSION� . If we don’t do that, by default it is assigned a “CONVESATION� scope and the stateful session bean does not exhibit the correct transactional behaviour.

      The question is - can we still use the same entity manger component for conversational beans or should we define another entity manager component with the default “Conversation� scope?