4

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.

Raje
  • 3,285
  • 15
  • 50
  • 70
  • It all depends on what’s acceptable to your users and the structure of your form. Are the fields of the form grouped into logical groups? In other words do certain fields need to be consistent with other fields? Is it acceptable for a user to be prevented from saving the form if it has been modified by another user? – munyengm Jul 19 '12 at 09:20
  • http://stackoverflow.com/questions/1423307/how-to-use-the-hibernate-optimistic-locking-version-property-on-the-front-end – Jigar Parekh Jul 19 '12 at 09:22
  • @munyengm: yes something like this. If one user update any field and submit form at the same time another user updates same form and try to submit then second user gets notification that "you can not submit form please take update. – Raje Jul 19 '12 at 10:38

1 Answers1

7

You're looking for optimistic concurrency control. With JPA/Hibernate, it can be as simple as adding an @Version annotated field in your entity.

JB Nizet
  • 678,734
  • 91
  • 1,224
  • 1,255