I have a class A, with a Set of references to class B (using lazy initialization) In Session X, I get dataobject a (class A). Then, session X is closed. Later I open a new Session Y, and I try to iterate the references to class B in dataobject a. Lazy initialization exception (no session or session closed) throw.
I would like to ask, in previous example, does it means that I cannot iterate other objects from object a (with lazy initialization) in another session? If it is the case, if the object a has to be used for long time, (while the session is short-lived), i can't use lazy initialization? (since when I iterates other objects from object a, the session retrieving object a previously may have been closed). Or any suggestion or workaround?
I'm using hibernate version 2.0.3
|