-->
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: index update and flush
PostPosted: Fri Dec 26, 2008 2:20 pm 
Regular
Regular

Joined: Fri Dec 17, 2004 10:38 am
Posts: 54
Hello

i'm writing a small test for my hibernate-search enabled application.
I start a new transaction, create an instance of my indexed entity, store it, query using FullTextQuery and rollback the transaction.

Since i do not commit my transaction before search there is nothing in the lucene index and query returns with no results.
Is there any way to force this index flush? Or even better - define synchronize regions just like with ordinary hibernate queries?
Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 26, 2008 7:31 pm 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Hi,
yes you can flush the changes to the index using
Code:
fullTextSession.flushToIndexes();

but consider that if you rollback the transaction the data won't appear in the DB but will stay in 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.  [ 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.