-
1. Re: stateful bean passivation problem is unclear
evrim Oct 3, 2005 3:14 AM (in response to evrim)i've got some answers from spec, summarizing here in order to double check:
Ejb3-spec-ejbcore says: (page 58)
In advanced cases, a session object's conversational state may contain open resources, such as open sockets and open database cursors. A container cannot retain such open resources when a session bean instance is passivated. A developer of a stateful bean must close and open the resources in the PrePassivate and PostActive(subnote 8)
And subnote 8 reads:
Note that this requirement does not apply to the EntityManager and EntityManagerFactory objects.
So, any stateful session bean developer does not have to flush() or do something inside @PrePassivate.
Is this true for jboss4,ejb3? -
2. Re: stateful bean passivation problem is unclear
evrim Oct 3, 2005 3:24 AM (in response to evrim)More answers (my lucky day):
Ejb3-spec-ejbcore reads: (page 59)
The bean provider must assume that the content of transient fields may be lost between PrePassivate and PostActivate notifications. There, the bean provider should not store in a transient field a references to any of the following objects: SessionContext object; environment JNDI naming context and any its subcontexts; business interfaces; home and component interfaces; EntityManager interface; EntityManagerFactory interface; UserTransaction interface.
Ok. i've learned that they won't be transient. Same question: Is this legal for jboss4/ejb3?
My last problem is hibernate load while passivation. Let me try to re-attack the problem.