christian wrote:
optimistic-lock="dirty" should definitely NOT be the default. For some entities you might be able to accept concurrent modifications, for most you don't. With optimistic-lock="dirty" one user could change the price of an item, while the other changes the description, and there would be no conflict detected. This is certainly wrong from a business perspective.
Actually, what is wrong with that, for your
very specific scenario, I would argue it's okay. The two pieces of data are not 'related'.
Another example:
I log into some system and update my email, as it changed. At the same time another user updates my customer status, as they were reviewing my record and saw I'd purchased enough product to be elevated. Again, two unrelated pieces of data, so why should a conflict occur? It increases concurrency.
Cheers,
Stu