About Question enthuware.oce-ejbd.v6.2.482 :
Posted: Sat May 28, 2011 3:35 pm
Typo in B:
clientStateRepresentaion --> clientStateRepresentation
clientStateRepresentaion --> clientStateRepresentation
Java Certification Resources and Java Discussion Forum
http://enthuware.com/forum/
or1. Mark currentClientState as transient.
2. Initialize the clientStateRepresentation in @PrePassivate and recreate currentClientState in @PostActivate.
1. Set currentClientState to null in @PrePassivate method.
2. Initialize the clientStateRepresentation in @PrePassivate and recreate currentClientState using clientStateRepresentation in @PostActivate.
Fixed.negociadordns wrote:A funny typo:
In the explanation of answer "Write the contents of currentClientState to a file in @PrePassivate and read them back in @PostActivate."
It is written a zero instead of an O letter in I/O:
"Beans are not allowed to use File I/0."
First, the currentClientState is set to null. It is not refering to the original value. In the @PostActivate method, the currentClientState refers to a new value.Set currentClientState to null in @PrePassivate method.
2. Initialize the clientStateRepresentation in @PrePassivate and recreate currentClientState using clientStateRepresentation in @PostActivate.
In this way, the currentClientState is preserved in the string.store the state of currentClientState in clientStateRepresentation in PrePassivate...