I am trying to develop an application using Spring 2.5.5 Flex/J2EE and Hibernate 3.1.3.
My problem is that when a user opens the “Customer Information” screen and then displays informations of a client in change mode, I want the record to be locked (Pessimistic or optimistic lock Lock) as appropriate. And registration remains locked until the user validates the change (commit ()) or closes the screen.
They talk on the net about long conversation (Hibernate), and openSessionInView pattern. But I have not found a clear example.
The solution is to keep the Hibernate session open until the end of entry.
then made the commit or rollback.
I try to use the class: “org.springframework.orm.hibernate3.support.OpenSe ssionInViewInterceptor” but I did not succeed.
I do not know how to configure it with Spring.
I spent too much time and it becomes urgent … Who can help me??
Thank you in advance.
OpenSessionInViewInterceptor has to be configured in your web.xml
Sample below:
Also check the documentation for subtle issues.