Is Hazelcast IMap.lock() on Map better than ILock.lock() which is deprecated in version 3.12? Can we continue with the usage of IMap.lock() or is it too projected to be deprecated? What are the specific advantages of using locks on Map? Are locks on the map written on the same partition as that of the key? If so, where(which area of Hazelcast Distributed memory) are the general locks not tied to maps written to?
Lock mylock = Hazelcast.getLock(mylockobject);
mylock.lock(); **//Deprecated**
try {
//dosomething
}finally{
mylock.unlock();
}
IMap map = Hazelcast.getMap("customers"); map.lock("1"); //Not deprecated
try {
//dosomething
}finally{
map.unlock("1");
}