문제

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