Hi,
I've been creating some application with struts and hibernate, and I have some weird behavior when saving the items.
First I followed the Open Session in View (
http://www.hibernate.org/43.html) to implement the filter for opening/closing transaction. But I noticed that sometimes the data is not written to the database. So I googled it, and some people say that session needs to be closed at the end after the transaction is committed. (For some reason, the sample code provided by Open Session in View does not close the session). So I tried to modify the code and close the session when the transaction is commited. But everytime I do that, I get exception says "Session is closed!".
If I am using struts and developing web application, I don't have to close the session?
If so, is there anything I need to be careful about so that all values are written to the database? Most of the time, the data is written to the database without problem, but sometimes, very rarely though, the data is not.
Thanks,