We develope a web application using OOP, java, spring, JPA, hibernate, JSF.
When we select an object from the database and display it and the user tries to update it, we get this exception if the row was already updated by another user before.
"Row was updated or deleted by another transaction"
What would be the best way of handling this situation?
Warning the user like "data has changed, would you control it again please"? (But in an intense environment maybe she would never find a space to update)
Just selecting the row again and overwriting the new object? (For the variables like integer maybe we get the difference and add it, then we have to implement methods take only one field as parameter, and we can't let user edit multiple fields at one time)
Is there an approach or library you can suggest? Or do we have to implement our own mechanism?
Thanks
Aucun commentaire:
Enregistrer un commentaire