1 Reply Latest reply on Sep 26, 2006 10:46 AM by manik

    Possible misunderstandig of the optimistic  locking

    jl

      Hallo,

      after many trys to run the cluster under pessimistic locking, we want to change to optimistic locking.
      Our cache has a lot of node like

      /sentinel/[sessionId]

      and /sentinel_Commands/[sessionId]

      where [sessionId] is a unique identifier of an user. So the number of this

      Fqn will scale with the number of logged in users.

      All this nodes will be changed frequently. When I use the optimistic locking
      I got the following exception during the commit phase and I'm mostly surprised about the line:

      Caused by: org.jboss.cache.CacheException: DataNode [/] version Ver=74 is newer than workspace node Ver=73

      Means this each change on a sub node will also increase the version of the root node and the commit phase will only work if there was no change in the complete treecache?

      How it's possible that a commit works than if many cluster nodes will do changes on different (sub)nodes in the tree cache?





      2006-09-21 09:52:23,321 [SentinelServerAgent_105] ERROR org.jboss.cache.transaction.DummyTransaction - beforeCompletion() failed for tx=org.jboss.cache.transaction.DummyTransaction@f91da9, handlers=[TxInterceptor.LocalSynchronizationHandler(gtx=GlobalTransaction:<192.168.4.174:7800>:78, tx=org.jboss.cache.transaction.DummyTransaction@f91da9)]
      java.lang.RuntimeException:
      at org.jboss.cache.interceptors.TxInterceptor$LocalSynchronizationHandler.beforeCompletion(TxInterceptor.java:1091)
      at org.jboss.cache.interceptors.OrderedSynchronizationHandler.beforeCompletion(OrderedSynchronizationHandler.java:75)
      at org.jboss.cache.transaction.DummyTransaction.notifyBeforeCompletion(DummyTransaction.java:247)
      at org.jboss.cache.transaction.DummyTransaction.commit(DummyTransaction.java:54)
      at org.jboss.cache.transaction.DummyBaseTransactionManager.commit(DummyBaseTransactionManager.java:61)
      at com.xtramind.common.distributed.DefaultDistributedResourceAgent.putData(DefaultDistributedResourceAgent.java:526)
      at com.xtramind.common.distributed.DefaultDistributedResourceManager.putData(DefaultDistributedResourceManager.java:167)
      at com.xtramind.common.sentinel.server.DefaultSentinelServerAgent.addCommand(DefaultSentinelServerAgent.java:805)
      at com.xtramind.common.sentinel.server.DefaultSentinelServerAgent.answerToServerPing(DefaultSentinelServerAgent.java:255)
      at com.xtramind.common.sentinel.server.DefaultSentinelServerAgent.run(DefaultSentinelServerAgent.java:320)
      at java.lang.Thread.run(Thread.java:595)
      Caused by: org.jboss.cache.CacheException: DataNode [/] version Ver=74 is newer than workspace node Ver=73
      at org.jboss.cache.interceptors.OptimisticValidatorInterceptor.simpleValidate(OptimisticValidatorInterceptor.java:127)
      at org.jboss.cache.interceptors.OptimisticValidatorInterceptor.validateNodes(OptimisticValidatorInterceptor.java:101)
      at org.jboss.cache.interceptors.OptimisticValidatorInterceptor.invoke(OptimisticValidatorInterceptor.java:66)
      at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:68)
      at org.jboss.cache.interceptors.OptimisticLockingInterceptor.invoke(OptimisticLockingInterceptor.java:95)
      at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:68)
      at org.jboss.cache.interceptors.OptimisticReplicationInterceptor.invoke(OptimisticReplicationInterceptor.java:74)
      at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:68)
      at org.jboss.cache.interceptors.TxInterceptor.runPreparePhase(TxInterceptor.java:804)
      at org.jboss.cache.interceptors.TxInterceptor$LocalSynchronizationHandler.beforeCompletion(TxInterceptor.java:1069)



      Thanks for help

      JL