Thanks for the reply.
So if I need to read a node, then write to it, such as:
| // force write lock even on read operations
| // read node
| Object value = cache.get(myFqn, "key");
| // write node
| cache.put(myFqn, "key", "newValue");
Will the "setForceWriteLock(true)" applied to both cache.get() and cache.put()
It looks like the InvocationContext is a ThreadLocal variable (looking at the
CacheInvocationDelegate class), which means it lasts as long as the thread is still
active. In other words, once I set the "setForceWriteLock(true)", all future
cache related operations in this thread will see this option set to "true". And
if a thread pool is used in my application for processing (such as a pool of JMS consumer
threads), I won't know which options are set and which aren't.
Is my observation correct?
View the original post :
Reply to the post :