1 Reply Latest reply on Oct 18, 2007 8:01 AM by pmuir

    SMPC:@In EntityManager or @PersistenceContext ?

    dkane

      Dear colleagues,

      I've read a lot about advantages of SMPC in this forum.
      In documentation, the recommended way to configure and use SMPC is :

      components.xml :

      <core:managed-persistence-context name="bookingDatabase"
       auto-create="true"
      persistence-unit-jndi-name="java:/EntityManagerFactories/bookingData"/>


      Java code :
      @In EntityManager bookingDatabase;


      The best way of learning is examples , and I am looking into Seam 2.0 examples directory then.
      Almost all examples contains the corresponding configuration tag in components.xml.
      However, entityManager is being injected with @PersistenceContext or
      @PersistenceContext(TYPE=EXTENDED) in the vast majority of Java code. The canonical examples Booking and DVDStore does that too.

      Is SMPC actually used in Seam examples ? If not (BTW, why ?), where can I see sources of complete SMPC application ?

      Thank you.