Package io.jmix.dynmodel.impl.cluster
Class PessimisticClusterApplyLock
java.lang.Object
io.jmix.dynmodel.impl.cluster.PessimisticClusterApplyLock
- All Implemented Interfaces:
ClusterApplyLock
Apply lock backed by the pessimistic lock add-on. The lock is cluster-wide when the application is
configured with a distributed cache.
LockManager.expireLocks() evicts a lock purely by its age against
jmix.dynmodel.cluster.apply-lock-timeout-sec; there is no heartbeat, so an apply that is still
running after that timeout looks exactly like a lock left behind by a crashed node: another node then
takes the lock and applies at the same time. The timeout must therefore be set above the longest apply
the application can produce.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionPessimisticClusterApplyLock(LockManager lockManager, DynModelProperties properties) -
Method Summary
-
Field Details
-
LOCK_NAME
- See Also:
-
LOCK_ID
- See Also:
-
RETRY_INTERVAL_MS
protected static final long RETRY_INTERVAL_MS- See Also:
-
-
Constructor Details
-
PessimisticClusterApplyLock
-
-
Method Details
-
acquire
public void acquire(boolean wait) Description copied from interface:ClusterApplyLockTakes the lock.- Specified by:
acquirein interfaceClusterApplyLock- Parameters:
wait- true to retry until the configured wait time has passed
-
release
public void release()Description copied from interface:ClusterApplyLockReleases the lock.- Specified by:
releasein interfaceClusterApplyLock
-