Closed MaheshGowda26 closed 1 year ago
Hi Team, could you please help me with below code that migration to ehcahe3
Ehcache2 code. public void acquireReadLockOnKey(Object key) { this.acquireLockOnKey(key, LockType.READ); }
public void acquireWriteLockOnKey(Object key) { this.acquireLockOnKey(key, LockType.WRITE); }
TIA
public boolean tryReadLockOnKey(Object key, long timeout) throws InterruptedException { Sync s = getLockForKey(key); return s.tryLock(LockType.READ, timeout); }
public boolean tryWriteLockOnKey(Object key, long timeout) throws InterruptedException { Sync s = getLockForKey(key); return s.tryLock(LockType.WRITE, timeout); }
public void releaseReadLockOnKey(Object key) { releaseLockOnKey(key, LockType.READ); }
public void releaseWriteLockOnKey(Object key) { releaseLockOnKey(key, LockType.WRITE); }
boolean isReadLockedByCurrentThread(Object key);
boolean isWriteLockedByCurrentThread(Object key);
There are no directly corresponding methods. In order to know how to migrate this code I would need to know what these methods are being used to accomplish at a higher level.
Hi Team, could you please help me with below code that migration to ehcahe3
Ehcache2 code. public void acquireReadLockOnKey(Object key) { this.acquireLockOnKey(key, LockType.READ); }
public void acquireWriteLockOnKey(Object key) { this.acquireLockOnKey(key, LockType.WRITE); }
TIA
public boolean tryReadLockOnKey(Object key, long timeout) throws InterruptedException { Sync s = getLockForKey(key); return s.tryLock(LockType.READ, timeout); }
public boolean tryWriteLockOnKey(Object key, long timeout) throws InterruptedException { Sync s = getLockForKey(key); return s.tryLock(LockType.WRITE, timeout); }
public void releaseReadLockOnKey(Object key) { releaseLockOnKey(key, LockType.READ); }
public void releaseWriteLockOnKey(Object key) { releaseLockOnKey(key, LockType.WRITE); }
boolean isReadLockedByCurrentThread(Object key);
boolean isWriteLockedByCurrentThread(Object key);