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

floefliep do-not-reply at jboss.com
Fri Jul 14 04:53:09 EDT 2006


Sorry for my late reply, been too busy yesterday.

anonymous wrote : So I am missing something. You mean to tell me that TreeCache.remove() *fails* if the node does not exist even when you explicitly specify "fail silently"? I needed the "protection check" in OptimisitcTreeCache.remove() because there I cannot explcitly set the fail-silectly mode... 
Yes, that I is what I mean. Actually, ironically, I didn't pay attention to why you wrote that there, I just read it didn't work well, so I thought you were referring to a known bug and I used the "protected" remove call and it worked. FYI, the stack:

System Thread [RMI TCP Connection(9)-192.168.1.72] (Suspended (exception NullPointerException))
	OptimisticNodeInterceptor.invoke(MethodCall) line: 68
	OptimisticCreateIfNotExistsInterceptor(Interceptor).invoke(MethodCall) line: 68
	OptimisticCreateIfNotExistsInterceptor.invoke(MethodCall) line: 69
	OptimisticValidatorInterceptor(Interceptor).invoke(MethodCall) line: 68
	OptimisticValidatorInterceptor.invoke(MethodCall) line: 75
	OptimisticLockingInterceptor(Interceptor).invoke(MethodCall) line: 68
	OptimisticLockingInterceptor.invoke(MethodCall) line: 122
	TxInterceptor(Interceptor).invoke(MethodCall) line: 68
	TxInterceptor.handleNonTxMethod(MethodCall) line: 345
	TxInterceptor.invoke(MethodCall) line: 156
	CacheMgmtInterceptor(Interceptor).invoke(MethodCall) line: 68
	CacheMgmtInterceptor.invoke(MethodCall) line: 183
	TreeCache.invokeMethod(MethodCall) line: 5517
	TreeCache.remove(Fqn, Object) line: 3741
	TreeCache.remove(Fqn, Object, Option) line: 3296
	OptimisticTreeCache.writeLoad(Object, Object, Object) line: 77
	TransactionalCache.put(Object, Object, long, Object, Comparator, boolean) line: 55
	TwoPhaseLoad.initializeEntity(Object, boolean, SessionImplementor, PreLoadEvent, PostLoadEvent) line: 156
	CriteriaLoader(Loader).initializeEntitiesAndCollections(List, Object, SessionImplementor, boolean) line: 842
	CriteriaLoader(Loader).doQuery(SessionImplementor, QueryParameters, boolean) line: 717
	CriteriaLoader(Loader).doQueryAndInitializeNonLazyCollections(SessionImplementor, QueryParameters, boolean) line: 224
	CriteriaLoader(Loader).doList(SessionImplementor, QueryParameters) line: 2145
	CriteriaLoader(Loader).listUsingQueryCache(SessionImplementor, QueryParameters, Set, Type[]) line: 2061
	CriteriaLoader(Loader).list(SessionImplementor, QueryParameters, Set, Type[]) line: 2021
	CriteriaLoader.list(SessionImplementor) line: 95
	SessionImpl.list(CriteriaImpl) line: 1562
	CriteriaImpl.list() line: 283

anonymous wrote : anonymous wrote : Exceptions all over the place Other than whats discussed above? What are they?
I was only silently hoping for an exception-free first run with the new OptmisticTreeCache, but then I again got exceptions. Admittedly, it's no big deal, but hence my "oh-no-not-again" feeling and I figured it was time to swap the debugger for a drink ;)
Well, you have the exception above, and the CacheException I now get once in a while, as mentioned above. It seems there is a problem with unexpected version increases/checks on the parent nodes, but I still haven't had the time to look into this. I think it must have to do something with the same parent nodes being touched originating from different child accesses; FYI the stack (I replaced package/object names I'm not allowed to disclose):

Caused by: org.jboss.cache.CacheException: DataNode [/com/myapp/hibernate] version org.hibernate.cache.OptimisticTreeCache$DataVersionAdapter at 4f5983 [current=16, previous=16, src=SingleTableEntityPersister(com.myapp.hibernate.ObjectB)] is newer than workspace node org.hibernate.cache.OptimisticTreeCache$DataVersionAdapter at 1ad108d [current=1, previous=1, src=SingleTableEntityPersister(com.myapp.hibernate.ObjectA)]
        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.TxInterceptor.runPreparePhase(TxInterceptor.java:796)
        at org.jboss.cache.interceptors.TxInterceptor$LocalSynchronizationHandler.beforeCompletion(TxInterceptor.java:1061)
        ... 73 more

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

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



More information about the jboss-user mailing list