The LOCK CLUSTER WITH
syntax is utilized to apply a lock with a specific algorithm to the CLUSTER
.
LockClusterWith ::=
'LOCK' 'CLUSTER' 'WITH' lockStrategy ('TIMEOUT' timeoutMillis)?
timeoutmillis ::=
long
CLUSTER
is already locked, it is impossible to re-lock it, otherwise an exception will be thrown.lockStrategy
supports two lock strategies, namely the exclusive lock WRITE
and the read-write lock READ_WRITE
.timeoutMillis
is used to indicate the timeout period for attempting to acquire the lock, with the unit being milliseconds. When not specified, the default value is 3,000 milliseconds.CLUSTER
with an exclusive lock without setting the timeout.LOCK CLUSTER WITH WRITE;
LOCK CLUSTER WITH READ_WRITE TIMEOUT 2000;
LOCK
,CLUSTER
,WITH