As far as I understand it, when using Hibernate DAOs, the scope of the session is limited to the actual method on the DAO. In order to do lazy loading against the returned object, you have to use the OpenSessionInView.
So, on our app, we're using that. If I pass in a detached object from the front end, and re-load it (using its ID), I can navigate the object graph in the service layer.
For some reason, though, if I save that object first, then try to navigate the graph in the service layer, I get a lazy-load exception. For that matter, if I save the object, then try to re-load it, I get the same exception.
How should I go about trying to save an object from the front-end, and then needing to navigate its graph to make relationship changes, all in the service layer?
jason


Reply With Quote