I'm working with detached persistent entities that get placed into an HttpSession, which means they may be serialized in a clustered environment. I'm concerned about sessions getting too large and serializing too much data if the object graph happens to be large (most of my collections and properties are lazy, but if the objects within them have been loaded, they'll get serialized, correct?).
What I'm wondering about is what will happen if I mark the member variable backing a hibernate collection or object reference as "transient." Obviously, the reference to the colleciton or object will be set to "null" when the object is serialized. What will happen later if I try to re-attach the object to a different session?
Will hibernate interpret that as a deletion of the entire collection? Or will an error occur? I'm going to attempt to set up a test to experiment, but I thought others could benefit from my documenting this question. In the mean time, if anyone knows the answer, please chime in!
|