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