-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: OptimisticTreeCacheProvider problem
PostPosted: Mon Jan 08, 2007 10:51 am 
Newbie

Joined: Mon Jan 08, 2007 10:28 am
Posts: 11
Hibernate version: 3.2.1
JBossCache version: 1.4.1.CR1

My application is really simple and work for all CRUD operations.
But, when I configure a second level cache with JBossCache, an execption occurs when I want to Delete an object.

Hibernate configuration:
- hibernate.cache.provider_class=org.hibernate.cache.OptimisticTreeCacheProvider
- objects are cached in transactional mode (<class...><cache usage="transactional"/>...</class>)

JBossCache configuration:
- OPTIMISTIC NodeLockingScheme
- REPL_ASYNC CacheMode

Full stack trace of any exception that occurs:
Code:
java.lang.RuntimeException:
        at org.jboss.cache.interceptors.TxInterceptor$LocalSynchronizationHandler.beforeCompletion(T
xInterceptor.java:1146)
        at org.jboss.cache.interceptors.OrderedSynchronizationHandler.beforeCompletion(OrderedSynchr
onizationHandler.java:75)
        at org.objectweb.jotm.SubCoordinator.doBeforeCompletion(SubCoordinator.java:1520)
        at org.objectweb.jotm.SubCoordinator.commit_one_phase(SubCoordinator.java:433)
        at org.objectweb.jotm.TransactionImpl.commit(TransactionImpl.java:248)
        at org.objectweb.jotm.Current.commit(Current.java:526)
        at org.springframework.transaction.jta.JtaTransactionManager.doCommit(JtaTransactionManager.
java:787)
        at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(
AbstractPlatformTransactionManager.java:500)
        at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(Abstrac
tPlatformTransactionManager.java:473)
        at org.springframework.transaction.interceptor.TransactionAspectSupport.doCommitTransactionA
fterReturning(TransactionAspectSupport.java:266)
        at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInte
rceptor.java:106)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvo
cation.java:170)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:176)
        at $Proxy2.supprimerCatalogue(Ljava.lang.String;)V(Unknown Source)
        at clara.prototype.applicatif.hibernatoo.impl.GererCataloguesImpl.supprimerCatalogue(GererCa
taloguesImpl.java:90)
        at clara.prototype.presentation.strutsoo.gerercatalogues.SupprimerCatalogueAction.execute(Su
pprimerCatalogueAction.java:63)
        at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419)

        at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)
        at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
        at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
        at jrockit.reflect.VirtualNativeMethodInvoker.invoke(Ljava.lang.Object;[Ljava.lang.Object;)L
java.lang.Object;(Unknown Source)
        at java.lang.reflect.Method.invoke(Ljava.lang.Object;[Ljava.lang.Object;I)Ljava.lang.Object;
(Unknown Source)
        at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:243)
        at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
        at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:275)
        at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:161)
Caused by: org.jboss.cache.optimistic.DataVersioningException: Attempting to apply data version of t
ype class org.hibernate.cache.OptimisticTreeCache$
NonLockingDataVersion to a node [fqn = /clara/prototype/persistant/hibernatoo/Catalogue/clara.protot
ype.persistant.hibernatoo.Catalogue#9] that already contains version of type class org.hibernate.cac
he.OptimisticTreeCache$DataVersionAdapter
        at org.jboss.cache.interceptors.OptimisticValidatorInterceptor.simpleValidate(OptimisticVali
datorInterceptor.java:144)
        at org.jboss.cache.interceptors.OptimisticValidatorInterceptor.validateNodes(OptimisticValid
atorInterceptor.java:110)
        at org.jboss.cache.interceptors.OptimisticValidatorInterceptor.invoke(OptimisticValidatorInt
erceptor.java:75)
        at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:68)
        at org.jboss.cache.interceptors.OptimisticLockingInterceptor.invoke(OptimisticLockingInterce
ptor.java:99)
        at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:68)
        at org.jboss.cache.interceptors.InvalidationInterceptor.invoke(InvalidationInterceptor.java:
60)
        at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:68)
        at org.jboss.cache.interceptors.TxInterceptor.runPreparePhase(TxInterceptor.java:859)
        at org.jboss.cache.interceptors.TxInterceptor$LocalSynchronizationHandler.beforeCompletion(T
xInterceptor.java:1124)
        at org.jboss.cache.interceptors.OrderedSynchronizationHandler.beforeCompletion(OrderedSynchr
onizationHandler.java:75)
        at org.objectweb.jotm.SubCoordinator.doBeforeCompletion(SubCoordinator.java:1520)
        at org.objectweb.jotm.SubCoordinator.commit_one_phase(SubCoordinator.java:433)
        at org.objectweb.jotm.TransactionImpl.commit(TransactionImpl.java:248)
        at org.objectweb.jotm.Current.commit(Current.java:526)
        at org.springframework.transaction.jta.JtaTransactionManager.doCommit(JtaTransactionManager.
java:787)
        at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(
AbstractPlatformTransactionManager.java:500)
        at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(Abstrac
tPlatformTransactionManager.java:473)
        at org.springframework.transaction.interceptor.TransactionAspectSupport.doCommitTransactionA
fterReturning(TransactionAspectSupport.java:266)
        at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInte
rceptor.java:106)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvo
cation.java:170)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:176)
        at $Proxy2.supprimerCatalogue(Ljava.lang.String;)V(Unknown Source)
        at clara.prototype.applicatif.hibernatoo.impl.GererCataloguesImpl.supprimerCatalogue(GererCa
taloguesImpl.java:90)
        at clara.prototype.presentation.strutsoo.gerercatalogues.SupprimerCatalogueAction.execute(Su
pprimerCatalogueAction.java:63)
        at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419)

        at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)
        at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
        at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)


It seems to be a problem with data version classes :
- org.hibernate.cache.OptimisticTreeCache$DataVersionAdapter
- org.hibernate.cache.OptimisticTreeCache$NonLockingDataVersion

I have posted this problem on JBossCache forum (http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3997600#3997600) but they consider that's a hibernate problem.

Rudy KROL


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 09, 2007 1:44 pm 
Newbie

Joined: Mon Jan 08, 2007 10:28 am
Posts: 11
The problem is that JBossCache considers that a node version shouldn't change from a type to an other type (ex : NonLockingDataVersion to DataVersionAdapter).

org.jboss.cache.interceptors.OptimisticValidatorInterceptor :
Code:
if (!realNode.getVersion().getClass().equals(workspaceNode.getVersion().getClass()) && checkNotInitialRootVersion(realNode))
{
     throw new DataVersioningException("Attempting to apply data version of type " + workspaceNode.getVersion().getClass() + " to a node [fqn = "+realNode.getFqn()+"] that already contains version of type " + realNode.getVersion().getClass());                 
}


Can somebody work with a JBossCache commiter to find an solution ?

Thanks.
Rudy KROL


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 09, 2007 4:09 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
make a small unit test that reproduces and illustrate the error and put it in jira if it still fails.

_________________
Max
Don't forget to rate


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.