| Beginner |
 |
Joined: Tue Oct 26, 2004 4:59 pm Posts: 23
|
|
We are trying to give lazy initializing a try in an attempt to cut down on the number of selects hibernate does when loading an object.
We are using WebWork2. The problem I've run into is we close the session at the end of the action. When a JSP tries to access a collection we got lazy initialization errors that said the session was closed.
The real trick was that in this case I had two collections in this class. Whichever collection was mapped first in the hibernate map file would work but the second would not. Removing the session.close() from the action fixed the problem.
So my question is what is the ideal solution for closing hibernate sessions when the view (JSP in this case) needs access to it?
Thanks,
Karl
|
|