Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Bean provider resp. for successful Passivation HFEJB 246

 
Nileesha Bojjawar
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Mock ExamP246 Q8
Which are required of the bean provider to ensure that the session bean is successfully passivated(choose all that apply)
A. provider must call ejbPassivate()
B. The provider must always add busness logic to the ejbPassivate() method, if the bean is stateful.
C. The provider must close any database connections before ejbPassivate completes.
D. The provider must assume that any state stored in instance fields marked transient will be lost.
E. The provider must assume that any reference to the SessionContext object will not survive passivation if the SessionContex object is not serializable.

I answerd C and D
But the answer is D, and C in the answer says "The rovider must not close any database connections before ejbPassivate completes"
I thought that the connections are not serializable and hence it has to be closed or nullified in the ejbPassivate method to cater for the bean going in to not ready state due to timeout in the passivate state.
I am confused.

Please clarify
Thanks
 
Nileesha Bojjawar
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Spec 7.4.1 It states,

that the Bean Provider must close all JDBC™ connections in ejbPassivate
and assign the instance’s fields storing the connections to null.

So i take it that the answer in HFEJB is a print mistake.


Regards
Nileesha
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic