mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-11-12 22:41:35 +00:00
Add Query.withLock(LockType) and withLock(LockType, LockWait) (#2116)
Add Query.withLock(LockType) and withLock(LockType, LockWait)
This commit is contained in:
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");
|
||||
|
||||
Reference in new issue
Block a user