Question

We have an application using Java and Hibernate. We use optimistic locking and a relational database. We have a common situation where we have a pool of resources, that two different users try to modify at the same time. One user is able to edit the resources, another user gets "stack-trace" on the screen. What is a common way to handle these situations? We could use pessimistic locking but that would significantly degrade the performance of the application...

Pas de solution correcte

Autres conseils

Instead of a stack trace, notify the user that there was a concurrent update to the data they were working on, and force them to refresh it before saving. Try to preserve whatever they have edited or your users will hate you.

Or were you looking for a technical solution?

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top