Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

another question from ibm.158 ice

 
Axel Janssen
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic