-->
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.  [ 1 post ] 
Author Message
 Post subject: Error when hibernate.cache.auto_evict_collection_cache=true
PostPosted: Fri Apr 04, 2014 8:00 am 
Newbie

Joined: Wed Apr 02, 2014 3:55 am
Posts: 1
Hi all,

After activating the "hibernate.cache.auto_evict_collection_cache" property, I am getting this error on saving entities updates.
Quote:
org.hibernate.HibernateException: Unable to resolve property:
at org.hibernate.tuple.entity.EntityMetamodel.getPropertyIndex(EntityMetamodel.java:1215)
at org.hibernate.cache.internal.CollectionCacheInvalidator.evictCache(CollectionCacheInvalidator.java:130)
at org.hibernate.cache.internal.CollectionCacheInvalidator.onPostInsert(CollectionCacheInvalidator.java:80)
at org.hibernate.action.internal.EntityInsertAction.postInsert(EntityInsertAction.java:177)
at org.hibernate.action.internal.EntityInsertAction.execute(EntityInsertAction.java:145)
at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:463)
at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:349)
at org.hibernate.event.internal.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:350)
at org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:56)



I think that the problem is when checking for the mappedBy property on a collection persister: when empty, It returns an empty string instead of null.

The error is thrown by the following lines in org.hibernate.cache.internal.CollectionCacheInvalidator.java:


Code:
// this is the property this OneToMany relation is mapped by
String mappedBy = collectionPersister.getMappedByProperty();
if ( mappedBy != null ) {
   int i = persister.getEntityMetamodel().getPropertyIndex( mappedBy );
   ...
}


Is this an Hibernate issue ?

Thank you.

Note: I am using Hibernate 4.3.5.Final with JPA 2.1.


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

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.