Hey all,
As you all know, lazy loading requires an open and connected session. On the other hand, I don't want to keep open sessions more than I must and I close them as soon as I finish my transactions. This however causes problems with lazy loading.
I have several solutions but I can't understand why is this a problem in the first place. The method ThrowLazyInitializationExceptionIfNotConnected (in AbstractPersistentCollection) only checks to see if the session is disconnected, why does it not try to reconnect?
Or we could make this configurable...
Thanks, Vadim.
|