[jboss-user] [JBoss Cache: Core Edition] - Workspace node version is 1 after repeated optimistic lockin
do-not-reply at jboss.com
Tue Jul 21 08:42:42 EDT 2009
In my code using JBoss Cache v1.4.1SP9, a load test fails with the cause
org.jboss.cache.optimistic.DataVersioningException: DataNode [/ItemCache/com.afl.uefa.billing.card.util.cache.AccountClusteredItemCache/141] version Ver=2 is newer than workspace node Ver=1
This looks like an optimistic locking conflict but my code already handles this by sleeping for half a second and retrying up to five times. I suspect the load test fails because it creates 20 threads, they all try to write the same value to the same node at the same time and the fixed retry delay means all the lock losers retry at the same time.
This suggests an obvious solution but the error log suggests my theory is wrong. The lock losing threads should be giving up after the fifth attempt but the lock winning threads would have incremented the actual node version to 6. It could be that the version is not incremented whenever setting the node's value with a new value that's equal to it. Can anyone confirm this? Is there a different explanation for the version being 2?
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4244968#4244968
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4244968
More information about the jboss-user