Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.Original topic: 悲观锁乐观锁内存悲观锁

Have you ever used pessimistic locks and optimistic locks in practice?
Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.Original topic: 悲观锁乐观锁内存悲观锁
Have you ever used pessimistic locks and optimistic locks in practice?
Higher versions only support in-memory pessimistic locks, so business retries need to be added.
The default pessimistic lock and optimistic lock were from earlier versions, and now they can be considered as non-existent.
By default, it’s pessimistic. If needed for business, you can try modifying the session or global settings to see if it works.
The current environment is most suitable for pessimistic locking.