Package com.landawn.abacus.jdbc
Class DBLock
java.lang.Object
com.landawn.abacus.jdbc.DBLock
Supports global lock by db table.
- Since:
- 0.8
- Author:
- Haiyang Li
-
Field Details
-
LOCKED
- See Also:
-
UNLOCKED
- See Also:
-
DEFAULT_LOCK_LIVE_TIME
public static final int DEFAULT_LOCK_LIVE_TIME- See Also:
-
DEFAULT_TIMEOUT
public static final int DEFAULT_TIMEOUT- See Also:
-
-
Method Details
-
lock
- Parameters:
target
-- Returns:
-
lock
- Parameters:
target
-timeout
-- Returns:
-
lock
- Parameters:
target
-liveTime
-timeout
-- Returns:
-
lock
- Parameters:
target
-liveTime
-timeout
-retryPeriod
- the period to retry inserting record in database table to lock the target.- Returns:
null
if the target can't be locked in the period specified bytimeout
-
unlock
- Parameters:
target
-code
-- Returns:
- true, if successful
-
close
public void close()Close.
-