Win a copy of Succeeding with AI this week in the Artificial Intelligence and Machine Learning 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
  • Junilu Lacar
Sheriffs:
  • Tim Cooke
  • Jeanne Boyarsky
  • Knute Snortum
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • salvin francis
  • fred rosenberger
  • Frits Walraven

another question from ibm.158 ice

 
Ranch Hand
Posts: 2166
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can anybody elaborate on this question?
A developer is writing a BMP Entity Bean that caches a reference to a database connection in a private field. The bean also holds references to two other objects, neither of which is serializable. Those two referenced objects are created from the persistent state of the bean. Which of the following MUST the developer do to handle the passivation requirements for this entity bean?
a) Make the database connection reference field transient.
b) Make the fields that hold the references to the non-serializable objects transient.
c) Create a writeObject(ObjectOutputStream) method on the entity bean which throws an instance of java.io.NotSerializableException.
d) Create a writeObject(ObjectOutputStream) method on the entity bean which translates the object references into serializable form.
e) Create a readObject(ObjectInputStream) method on the entity bean which translates the serialized data back into the previously held object references.
Thanks Axel
 
Axel Janssen
Ranch Hand
Posts: 2166
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
o.k. here's my guess:
a) and b) are wrong. In EJB transient does not work. Its possible that fields retain their original value though they are declared transient (Monson-Haefel, 3rd ed. p. 60)
I think c), e).
Correct me if I am wrong
Axel
 
    Bookmark Topic Watch Topic
  • New Topic