This week's book giveaway is in the Raspberry Pi forum.
We're giving away four copies of Getting started with Java on the Raspberry Pi and have Frank DelPorte on-line!
See this thread for details.
Win a copy of Getting started with Java on the Raspberry Pi this week in the Raspberry Pi forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Liutauras Vilda
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Piet Souris

Bean provider resp. for successful Passivation HFEJB 246

 
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
joke time: What is brown and sticky? ... ... ... A stick! Use it to beat this tiny ad!
Low Tech Laboratory
https://www.kickstarter.com/projects/paulwheaton/low-tech-0
reply
    Bookmark Topic Watch Topic
  • New Topic