悲观锁(数据库提供实现) . 默认认为一定发生别人要修改我使用的数据. 那我就可以为我读取的数据加锁.
iselect * from table for update (写锁、排它锁)
Hibernate 如何来实现
i. get(Object,int,LockOption)方法设置读取模式
session.get(Customer.class, 5, LockOptions.UPGRADE);
iselect * from table for update (写锁、排它锁)
Hibernate 如何来实现
i. get(Object,int,LockOption)方法设置读取模式
session.get(Customer.class, 5, LockOptions.UPGRADE);