-->
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.  [ 2 posts ] 
Author Message
 Post subject: Stale index on update of collection
PostPosted: Tue Sep 27, 2011 9:11 am 
Pro
Pro

Joined: Wed Nov 05, 2003 7:22 pm
Posts: 211
Hi,

If you have the following entity structure

Car 1-1 Category *-* Country
A Category can be in multiple countries and one country can have multiple categories
A Car only belongs to one Category

The following index relations exist
Car=>Category=>Country

There is no index relation from Country to Category.

Let's say Car is created and indexed, with Category 5 and Country 1 and Country 2

Now, let's remove Category 5 from Country 2 and save Country 2.

My Car index now still holds a reference to category.country 2, even after a full reindexing with purge set to true.
If we explicitly resave Category 5 or Car, my Car index will remove the reference to category.country 2.

The same goes for adding a Category to a Country.

Now, this seems a little strange to me, especially the fact that a full reindexing does not resolve this issue.
Is this because there is no index relation from Country to Category?


Kind regards,
Marc


Top
 Profile  
 
 Post subject: Re: Stale index on update of collection
PostPosted: Wed Sep 28, 2011 3:51 am 
Hibernate Team
Hibernate Team

Joined: Thu Apr 05, 2007 5:52 am
Posts: 1689
Location: Sweden
Hi,

a full re-index should work. However, I am wondering how exactly you remove the category from the country? Is the relation between category and country bidirectional? And if so do you update both sides of the relation? That's a requirement for Hibernate in general. Maybe it would help if you post some of your code.

--Hardy


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.