-->
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: Embedded collection not indexed on owner update
PostPosted: Wed Jun 22, 2011 4:53 pm 
Newbie

Joined: Fri Jan 18, 2008 2:32 pm
Posts: 8
Hi,

I have an indexed entity that contains a Set annotated with @ElementCollection @IndexedEmbedded . When persisting the entity, the collection is indexed properly, but if I update the collection (add an element for example) on a managed instance and call flushToIndexes(), the changes are made only to the database and not to the index.

I implemented hashCode() and equals() on both the entity and the embeddable, added debug prints to see if they are called, and I see that they are called only for the embeddable after the flush.

A workaround I found is to change a property of the entity - when I do this along with the collection update, the collection is reindexed properly.

Is this a bug in the dirty check mechanism or am I doing something wrong?

Thanks.

_________________
Gabriel Axel
http://www.gabiaxel.com/


Top
 Profile  
 
 Post subject: Re: Embedded collection not indexed on owner update
PostPosted: Wed Jun 22, 2011 6:33 pm 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Hi,
this might be related to http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-780, could you check that the latest version in master solves your problem?

Also you can force this optimization to be disabled by using the configuration option hibernate.search.enable_dirty_check to false

_________________
Sanne
http://in.relation.to/


Top
 Profile  
 
 Post subject: Re: Embedded collection not indexed on owner update
PostPosted: Thu Jun 23, 2011 2:52 am 
Newbie

Joined: Fri Jan 18, 2008 2:32 pm
Posts: 8
As in this issue, in my case the collection is also defined in a superclass. When I moved the collection to the subclass it solved the problem without any other changes.

This works for me as I only need the collection for the subclass (I should have done this anyway, just didn't get to it yet).

Thanks.

_________________
Gabriel Axel
http://www.gabiaxel.com/


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.