[hibernate-issues] [Hibernate-JIRA] Created: (HHH-2486) CacheException when using Hibernate with JBoss Cache's optimistic locking

Rob Worsnop (JIRA) noreply at atlassian.com
Sun Mar 11 12:02:09 EDT 2007


CacheException when using Hibernate with JBoss Cache's optimistic locking
-------------------------------------------------------------------------

         Key: HHH-2486
         URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2486
     Project: Hibernate3
        Type: Bug

  Components: core  
    Versions: 3.2.2    
 Environment: Hibernate 3.2.2. 
JBoss Cache 1.4.1.SP2
Affects all database platforms
    Reporter: Rob Worsnop
 Attachments: testcase.zip

See http://forum.hibernate.org/viewtopic.php?p=2343590

org.hibernate.action.BulkOperationCleanupAction evicts entities and then evicts entity collections.

So, with the attached test case, it does the following (in pseudo-code):

remove /com/medq/test/A
remove /com/medq/test/A/bs // throws exception 

Obviously removing "/com/medq/test/A" also removes "/com/medq/test/A/bs", so the last line is superfluous (as well as causing an exception to be thrown).

Is there a reason why org.hibernate.cache.OptimisticTreeCache.clear doesn't call option.setFailSilently(true)? The exception  would be swallowed by JBoss Cache if it did.

Here's the stack trace:

org.hibernate.cache.CacheException: org.jboss.cache.CacheException: Unable to find parent node with Fqn /com/medq/test/A
   at org.hibernate.cache.OptimisticTreeCache.clear(OptimisticTreeCache.java:169)
   at org.hibernate.cache.TransactionalCache.clear(TransactionalCache.java:124)
   at org.hibernate.impl.SessionFactoryImpl.evictCollection(SessionFactoryImpl.java:874)
   at org.hibernate.action.BulkOperationCleanupAction.evictCollectionRegions(BulkOperationCleanupAction.java:142)
   at org.hibernate.action.BulkOperationCleanupAction.init(BulkOperationCleanupAction.java:103)
   at org.hibernate.engine.query.NativeSQLQueryPlan.coordinateSharedCacheCleanup(NativeSQLQueryPlan.java:134)
   at org.hibernate.engine.query.NativeSQLQueryPlan.performExecuteUpdate(NativeSQLQueryPlan.java:144)
   at org.hibernate.impl.SessionImpl.executeNativeUpdate(SessionImpl.java:1163)
   at org.hibernate.impl.SQLQueryImpl.executeUpdate(SQLQueryImpl.java:334)
   at com.medq.test.TestHibernate.main(TestHibernate.java:39)
Caused by: org.jboss.cache.CacheException: Unable to find parent node with Fqn /com/medq/test/A
   at org.jboss.cache.interceptors.OptimisticNodeInterceptor.removeNode(OptimisticNodeInterceptor.java:218)
   at org.jboss.cache.interceptors.OptimisticNodeInterceptor.invoke(OptimisticNodeInterceptor.java:110)
   at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:68)
   at org.jboss.cache.interceptors.EvictionInterceptor.invoke(EvictionInterceptor.java:88)
   at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:68)
   at org.jboss.cache.interceptors.OptimisticCreateIfNotExistsInterceptor.invoke(OptimisticCreateIfNotExistsInterceptor.java:69)
   at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:68)
   at org.jboss.cache.interceptors.OptimisticValidatorInterceptor.invoke(OptimisticValidatorInterceptor.java:84)
   at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:68)
   at org.jboss.cache.interceptors.OptimisticLockingInterceptor.invoke(OptimisticLockingInterceptor.java:126)
   at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:68)
   at org.jboss.cache.interceptors.TxInterceptor.handleNonTxMethod(TxInterceptor.java:365)
   at org.jboss.cache.interceptors.TxInterceptor.invoke(TxInterceptor.java:160)
   at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:68)
   at org.jboss.cache.interceptors.CacheMgmtInterceptor.invoke(CacheMgmtInterceptor.java:183)
   at org.jboss.cache.TreeCache.invokeMethod(TreeCache.java:5776)
   at org.jboss.cache.TreeCache.remove(TreeCache.java:3855)
   at org.jboss.cache.TreeCache.remove(TreeCache.java:3438)
   at org.hibernate.cache.OptimisticTreeCache.clear(OptimisticTreeCache.java:166)
   ... 9 more 

As a workaround, the region name for the entity collection can be overridden so that it isn't underneath the entity in the tree.
In other words, something like "collections/com/medq/test/A/bs" instead of the default "com/medq/test/A/bs"




-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira




More information about the hibernate-issues mailing list