Add Query.withLock(LockType) and withLock(LockType, LockWait) (#2116)

Add Query.withLock(LockType) and withLock(LockType, LockWait)
This commit is contained in:
Rob Bygrave authored and GitHub committed 2020-12-01 21:31:53 +13:00
1 parent f6c4024ae5
commit c66875449b
8 files changed
+139 -7

No files matched your search

@@ -55,7 +55,7 @@ public class TestQueryForUpdatePostgresLock extends BaseTestCase {
private void lockArticle(Integer id) {
timePreLock = System.currentTimeMillis();
log.info("lock start");
DB.find(Article.class).setId(id).forUpdate(NO_KEY_UPDATE).findOne();
DB.find(Article.class).setId(id).withLock(NO_KEY_UPDATE).findOne();
sleep(1000);
timePostLock = System.currentTimeMillis();
log.info("lock done");