1 Reply Latest reply on Apr 25, 2007 5:05 PM by Carlo de Wolf

    Should EntityManager be transient?

    Philipp Taprogge Newbie

      Hello all!

      This might be a very stupid question. If so, please enlighten me... ;-)

      I was wondering:
      According to the specs, a stateful session bean has to be serializable so that the container can passivate it.
      Most stateful session beans will centain a @PersistenceContext declaring an EntityManager.
      Now I noticed that javax.persistence.EntityManager does not extend Serializable and thus makes no guarantee about whether the actual EntityManagerImpl injected by the container will be serializable.
      Should I declare references to EntityManager in my SSBs as "transient" to be on the safe side? Or will I run into other problems?