diff --git a/src/proxy/IMap.ts b/src/proxy/IMap.ts index b199e66d7..bee2fa1d7 100644 --- a/src/proxy/IMap.ts +++ b/src/proxy/IMap.ts @@ -343,6 +343,10 @@ export interface IMap extends DistributedObject { * Releases the lock for the specified key regardless of the owner. * This operation always unlocks the key. * + * **Warning:** This method should be used with caution. + * It releases the lock even if it was acquired by another client. + * That can lead to data inconsistencies if not used properly. + * * @param key the key of the map entry * @throws AssertionError if `key` is `null` */ @@ -351,6 +355,8 @@ export interface IMap extends DistributedObject { /** * Checks whether given key is locked. * + * This method returns `true` if the key is locked by any client. + * * @param key the key of the map entry * @throws AssertionError if `key` is `null` * @returns `true` if key is locked, `false` otherwise @@ -373,6 +379,10 @@ export interface IMap extends DistributedObject { * method must be called the same amount of times, otherwise the lock will * remain unavailable. * + * **Important:** + * In the Node.js client, all lock operations from the same client instance share the same lock ownership. + * This differs from the Java client where each thread has separate lock ownership. + * * @param key the key of the map entry * @param leaseTime lock is automatically unlocked after `leaseTime` * milliseconds; defaults to infinity @@ -542,6 +552,9 @@ export interface IMap extends DistributedObject { * `unlock()` method must be called the same amount of times, otherwise the * lock will remain unavailable. * + * **Important:** + * In the Node.js client, all lock operations from the same client instance share the same lock ownership. + * * @param key the key of the map entry * @param timeout server waits for `timeout` milliseconds to acquire * the lock before giving up; defaults to `0`