Hi,
I am using Struts + Hibernate. I am using "save" action and forwarding to "edit" action which will show JSP page with recently saved record. I am using "lazy" fetching strategy. To avoid LazyInitializationException, I implemented HibernateFilter and HibernateUtil class as explained on hibernate.org.
In this scenario, I am getting an exception org.hibernate.ObjectNotFoundException: No row with the given identifier exists:
Because, data is not committed and another request "edit" is fired which tries to fetch record.
Can anybody guide me for better approach to handle transactions in such scenarios or alternative of Open Session View in Filter?
Thanks,
Bhavin
[ October 30, 2008: Message edited by: Bhavin Sanghani ]
I am using Struts + Hibernate. I am using "save" action and forwarding to "edit" action which will show JSP page with recently saved record. I am using "lazy" fetching strategy. To avoid LazyInitializationException, I implemented HibernateFilter and HibernateUtil class as explained on hibernate.org.
In this scenario, I am getting an exception org.hibernate.ObjectNotFoundException: No row with the given identifier exists:
Because, data is not committed and another request "edit" is fired which tries to fetch record.
Can anybody guide me for better approach to handle transactions in such scenarios or alternative of Open Session View in Filter?
Thanks,
Bhavin
[ October 30, 2008: Message edited by: Bhavin Sanghani ]