1 Reply Latest reply on Jul 20, 2006 2:58 PM by Manik Surtani

    Optimistic Locking and CacheException problems

    K M Newbie

      Hi,

      We are using TreeCache with NodeLockingScheme=OPTIMISTIC, IsolationLevel=REPEATABLE_READ, CacheMode=INVALIDATION_ASYNC

      I'm having a hard time understanding how versioning works, and if it has some relation to equals/hashcode/tostring of our model objects (the ones that are mapped with hibernate). I have the following scenario in JMeter: 50 threads running simultaneously, searching for objects, creating new objects and persisting them. Only one instance of JBoss is running.

      Around 20% of the time we get the folling exception:

      Caused by: org.jboss.cache.CacheException: DataNode [/a/b/c/d/Telephone] version Ver=41 is newer than workspace node Ver=40

      As far as I understand, after a "put" there should be an "evict" so this situation shouldn't occur unless 2 threads update the same object simultaneously (however, we are creating different objects all the time)

      When I run with 10 threads or so the error does not occur.

      Hibernate is 3.2, JBoss is 4.0.4 and JBossCache 1.4