I have an application which uses struts and hibernate. I'm badly using the Open Session in View pattern the way is writting in
http://hibernate.org/43.html. The application is finished and I realize too late that the view is rendering before the commit and if an exeption is thrown the user see a successful page. This occurs unusually that is why I didn't realize before.
One suggestion is to commit in the data-management layer. Be couse I'd have to change a lot of code.
The other suggestion is to open two sessions, one in the filter and the other in the extended RequestProcessor.processActionPerform() method. Open a try-catch block, call ActionForward = super.processActionPerform() and close the session when going out the block. But what's about when rendering the view and it hits an unloaded collection or a proxy that isn't initialized.
Does the second suggestion solve the problem? Could any body who has implemented it write the code here?
Thanks a lot.