This article states that if we use 2 transactions one for getting first data and afterwords to get the lazy fields, we won’t run into any problems since the session is reused and the session itself guarantees repeatable read. But this doesn’t seem possible, session look to satisfy repeatable read requirements only when it comes to data that is already in its cache. But what if the object along with its underlying lazy OTO was removed? I understand that for collection it might not cause problems, it will simply return empty collection. But OTO… getChildField() will return proxy (since OTO configured with restricted=true), but it shouldn’t do that since everything is null already. Does anyone have an answer?
This article states that if we use 2 transactions one for getting first data
Share
The article says what you’re saying: loading objects on demand, across several transactions, is not reliable: