乐观锁定
适用于 ✅ 开源版 ✅ 专业版 ✅ 企业版
有两个设置控制 jOOQ 乐观锁功能 的行为
-
updateRecordVersion
:UpdatableRecord
实例在存储记录之前是否应修改记录版本。此功能独立于乐观锁,但与之相关。 -
updateRecordTimestamp
:UpdatableRecord
实例在存储记录之前是否应修改记录时间戳。此功能独立于乐观锁,但与之相关。 -
executeWithOptimisticLocking
: 这允许完全关闭该功能。 -
executeWithOptimisticLockingExcludeUnversioned
: 这允许为未显式版本化的可更新记录关闭该功能。
示例配置
Settings settings = new Settings() .withUpdateRecordVersion(true) // Defaults to true .withUpdateRecordTimestamp(true) // Defaults to true .withExecuteWithOptimisticLocking(true) // Defaults to false .withExecuteWithOptimisticLockingExcludeUnversioned(false); // Defaults to false
有关更多详细信息,请参阅 手册关于乐观锁功能的章节。
反馈
您对此页面有任何反馈吗? 我们很乐意听取您的意见!