Mark Spritzler wrote:This exception occurs when you don't have all your data in your objects, then leave the confines of a Session object.
So if I lazy load a Collection say Parent has a Collection of Children. If Children is lazy loaded and I call getChildren in the Parent object, and there is no Session open, then yoiu have no way to load that data, so it throws that exception. Either eager load the data when you query, or call the code within a Session.
This is because the Session object is actually stored within your entity object and that Session object is accessed every time the getter method is called