Thanks for the reply.

So if I need to read a node, then write to it, such as:

  |                     tm.begin();
  |                     // force write lock even on read operations
  |                     
cache.getInvocationContext().getOptionOverrides().setForceWriteLock(true);
  |                     
  |                     // read node
  |                     Object value = cache.get(myFqn, "key");
  | 
  |                     // write node
  |                     cache.put(myFqn, "key", "newValue");
  | 
  |                     tm.commit();
  | 

Will the "setForceWriteLock(true)" applied to both cache.get() and cache.put() 
operations?

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?

Thanks,



View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4257971#4257971

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4257971
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to