-->
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.  [ 4 posts ] 
Author Message
 Post subject: Know when index is synchronized
PostPosted: Wed Jul 21, 2010 3:54 am 
Newbie

Joined: Mon Aug 31, 2009 6:46 am
Posts: 11
Hi,

Is it possible to know when the index is in sync with Hibernate? I am using AOP as I want to trigger code to run after certain other code has run, & I want to be able to run a search but only when I am guaranteed that the index has been updated after a Hibernate insert/update/delete.

Thanks in advance,

Kevin.


Top
 Profile  
 
 Post subject: Re: Know when index is synchronized
PostPosted: Wed Jul 21, 2010 7:02 pm 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
but you need the indexing to be performed in async mode? because when the backend is configured "sync" (the default) just committing the transaction will guarantee that you can query on it and the changes have been applied already.

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


Top
 Profile  
 
 Post subject: Re: Know when index is synchronized
PostPosted: Thu Jul 22, 2010 8:05 am 
Newbie

Joined: Mon Aug 31, 2009 6:46 am
Posts: 11
Thanks for your reply, I need to do further investigation then, since maybe my AOP is keeping the transaction open because what is happenning is that I conduct the delete, then the AOP triggers 'After' that method has executed.

Then when I search I am getting a null in my results for the Hibernate object, but the Document object exists...

Thanks again,

Kevin.


Top
 Profile  
 
 Post subject: Re: Know when index is synchronized
PostPosted: Thu Jul 22, 2010 8:15 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
yes you have to make sure that your query is executed in a new transaction, after having committed the first one, to make sure you get an updated view of the index.

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


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