[jboss-user] [EJB 3.0] - Should EntityManager be transient?

taprogge do-not-reply at jboss.com
Mon Apr 23 11:04:43 EDT 2007


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?

Regards,

Phil

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4039881#4039881

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4039881



More information about the jboss-user mailing list