There are multiple common usecases I am looking at with distributed lock, few are below - 1. In a distributed application where application is running on more than 1 server node, want to synchronize some task for serial execution whenever there is common entity involved. 2. In concurrent environment, want to control updates to cache. this is like single transaction doing fetch and put after processing of cached value or kind of synchronous block execution.
many other common usecases. Here to work with Lock, lock method should return Lock instance and passed to unlock method in cache manager. I would have expected to just pass key to make it less tightly coupled. It is simple to workaround but now application code will have cache code which is what I am not agreeing with a little. Exception I faced said "Failed to unlock keys (did current thread acquire lock with this lock instance?)", it hints like same thread need to be used for unlock however it seems like misleading. Not same thread but same LOCK object instance need to be used for unlock. I will try lock and unlock in separate thread. --Sam -- View this message in context: http://apache-ignite-users.70518.x6.nabble.com/understanding-Locks-usage-tp7489p7522.html Sent from the Apache Ignite Users mailing list archive at Nabble.com.
