问题
My application is Multi-user application with server and client. In this one form is access by multiple user at the same time and they can perform save as draft or submit action.
The issue is that I want to control simultaneous editing of form by multi user.
For Example: User X is editing a value of textfield, checkbox and perform save as draft. And at the same time User Y edit the same value and submit form. Is there any way to control simultaneous form editing. any pointer?
I am using java , spring 3 , hibernate JPA in application.
回答1:
You're looking for optimistic concurrency control. With JPA/Hibernate, it can be as simple as adding an @Version annotated field in your entity.
来源:https://stackoverflow.com/questions/11557537/how-to-handle-form-editing-in-a-multi-user-environment