It depends;) With @Inject and other CDI annotations, you should check chapter 6.6 of the JSR-299 specification . You have information in which beans are "passivable."
About a session of standless and singleton beans, according to the EJB specification, they cannot be serialized (since passivation of ejb does not occur)
Think, and the most problematic is the beans state session. All JavaEE resources (EJB, InitialContext, SessionContext, etc.) will be restored after activation, but you must take care of other non-serializable fields and open connections. Thus, in your IMHO case, you should mark the Unit acceleration as transient and restore it in the ejbActivate event or enable CDI and creation methods to automatically enter the field.
source share