[jboss-user] [JBossCache] - Re: TreeCache/Hibernate/JBossAS optimistic locking problem

floefliep do-not-reply at jboss.com
Tue Jul 11 05:53:41 EDT 2006


More news:

It seems it is happening with the query cache enabled, since at the location of the exception the toString() of workspaceNode is:

WorkNode fqn=/org/hibernate/cache/StandardQueryCache dirty ver=null

When I disable the query cache, I get another similar exception:

Caused by: java.lang.NullPointerException
        at org.hibernate.util.ComparableComparator.compare(ComparableComparator.java:13)
        at org.hibernate.cache.OptimisticTreeCache$DataVersionAdapter.newerThan(OptimisticTreeCache.java:258)
        at org.jboss.cache.interceptors.OptimisticValidatorInterceptor.simpleValidate(OptimisticValidatorInterceptor.java:124)
        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.TxInterceptor.runPreparePhase(TxInterceptor.java:796)
        at org.jboss.cache.interceptors.TxInterceptor$LocalSynchronizationHandler.beforeCompletion(TxInterceptor.java:1061)
        ... 73 more

Now in order to force it to proceed, I tried to patch org.hibernate.util.ComparableComparator.compare()
by adding  if (x == null) return -1;

This seems to make it work, but I get:
WARN  [OptimisticTreeCache] Unexpected optimistic lock check on inserted data

It seems that the core of the problem is that org.hibernate.cache.OptimisticTreeCache$DataVersionAdapter.previousVersion is null in some cases, probably set by org.hibernate.cache.OptimisticTreeCache.writeLoad(), but I have no clue as to why these lock checks occur, or whether these instances with a version or previousversion set to null are ok.


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

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3956920



More information about the jboss-user mailing list