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...

No correct solution

OTHER TIPS

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?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top