[jboss-user] [JBoss Cache] - return value from AdvancedCache.lock
Mark Miller
do-not-reply at jboss.com
Mon Dec 12 10:05:34 EST 2011
Mark Miller [http://community.jboss.org/people/millerm120] created the discussion
"return value from AdvancedCache.lock"
To view the discussion, visit: http://community.jboss.org/message/641094#641094
--------------------------------------------------------------
The AdvancedCache.lock methods return a boolean which according to the JavaDoc is true if lock acquired and false if it is not acquired.
| | * @return true if the lock acquisition attempt was successful for <i>all</i> keys; false otherwise. |
All of the sample code I have seen looks like this:
tx.begin() cache.lock(K) // acquire cluster wide lock on K
cache.put(K,V5) // guaranteed to succeed
tx.commit() // releases locks
and does not check the return value of the lock call.
Is it possible for the call to lock to return false or will it always either return true or throw an exception?
Thanks in advance,
Mark
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/641094#641094]
Start a new discussion in JBoss Cache at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2052]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20111212/c6713b9c/attachment.html
More information about the jboss-user
mailing list