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

没有正确的解决方案

其他提示

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?

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top