Optimistic vs. Pessimistic locking

前端 未结 10 1066
庸人自扰
庸人自扰 2020-11-21 22:35

I understand the differences between optimistic and pessimistic locking. Now could someone explain to me when I would use either one in general?

And does the answer

10条回答
  •  遥遥无期
    2020-11-21 23:14

    I would think of one more case when pessimistic locking would be a better choice.

    For optimistic locking every participant in data modification must agree in using this kind of locking. But if someone modifies the data without taking care about the version column, this will spoil the whole idea of the optimistic locking.

提交回复
热议问题