-
1. Re: Infinispan lock API
rvansa Apr 22, 2015 3:42 AM (in response to prasadr141)1. No, you would get UnsupportedOperationException("Calling lock() on non-transactional caches is not allowed"). You can't even use locking with optimistic transactions, here you'd get
InvalidCacheUsageException("Explicit locking is not allowed with optimistic caches!")
2. This is not possible - the key is actually written to the cache during the commit, when you call put(), it's only recorded in transaction and locked (with pessimistic transactions). Therefore, you cannot unlock it prematurely.
3. This exposes internal state of locks; it seems that it's used mostly from tests to assert if some keys are locked, and to retrieve statistics... It gives you info only about node-local locks, so I wouldn't recommend you to try to use it unless you exactly know what you want to do.