Originally posted by Simon See:
Wait a minute, I think Q2 is D. What do you guys think?
I do agree A cannot be ruled out as well
But I have a question - Why is it not possible for the container to initialize the transient fields?
Originally posted by Lasse Koskela:
Because the bean developer told him not to by declaring those fields as transient? The transient keyword doesn't prevent reinitialization (serialization/deserialization) technically but it does prevent it logically. It's a bit like the "DON'T WIPE THIS!" text on a whiteboard...
The java serialization does reinitialize the trasient fields as well.
Umm. Now you've lost me Pradeep. This is the reason for what? Well, anyway the container could read the state using reflection and store it -- including transient variables -- into a persistent storage for later.
I think the reason is beacause the container can use mechanisms other than the Java serialization.