public interface TibLock
To create a lock object, see
Realm.createLock
.
If a client process exits or disconnects from the persistence server, the library automatically releases all the locks that the process holds.
This file defines the calls that manipulate locks. In addition, map objects and map iterator objects have methods that operate while holding a lock.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
PROPERTY_DOUBLE_LOCK_ACQUIRE_RETRY_DURATION
Retry duration for lock requests.
|
Modifier and Type | Method and Description |
---|---|
void |
destroy()
Destroy a local lock object and reclaim its resources.
|
boolean |
request()
No operation.
|
void |
returnLock()
Release a lock.
|
void |
steal()
Forcibly acquire a lock, even if another process holds it.
|
static final java.lang.String PROPERTY_DOUBLE_LOCK_ACQUIRE_RETRY_DURATION
Supply this property to Realm.createLock
.
This determines the number of seconds the client will attempt to acquire the lock. The client may retry if it can't access the persistence server, or wait if another client owns the lock. If the client does not already own the lock, the client attempts to acquire it when any map operation requiring a lock is called.
This value must be positive or zero. A value of 0 (zero) specifies no wait duration.
boolean request() throws FTLException
In releases earlier than 5.0, this call requested a lock from its persistence store.
In Release 5.0 and later,
this call is no longer necessary;
it returns true
without any other effect.
Calls that require a lock automatically request it; see:
TibMap.set(String, Message, TibLock)
TibMap.get(String, TibLock)
TibMap.remove(String, TibLock)
TibMap.createIterator(TibLock, TibProperties)
Programs that correctly used earlier versions of lock calls continue to operate properly.
true
.FTLException
void steal() throws FTLException
FTLException
void returnLock() throws FTLException
If the process does not hold the lock, this call has no effect.
FTLException
void destroy() throws FTLException
If the process holds the lock, this call returns the lock before destroying the object.
FTLException