-->
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.  [ 5 posts ] 
Author Message
 Post subject: How to disable automatic indexing after transaction commit?
PostPosted: Sat Aug 11, 2007 5:40 am 
Newbie

Joined: Sat Aug 11, 2007 5:35 am
Posts: 1
I want to asynchronous update the index at regular time intervals, e.g. 1 time every day,
so I have to disable the automatic index after the transaction is committed, how can i do that?


Top
 Profile  
 
 Post subject:
PostPosted: Sat Aug 11, 2007 8:49 am 
Beginner
Beginner

Joined: Tue Aug 26, 2003 2:46 pm
Posts: 45
Location: Saskatoon SK Canada
I don't think Hibernate has any control over when an index in the database is updated. Your best bet is to check your database documentation to see if that is possible.

I'm not sure why you would want that, anyway. If an index is not updated when the data is inserted/updated/deleted in the table, then the index is unusable. The index wouldn't know about new/changed rows that were inserted/updated, or worse, point to rows that no longer exist.

_________________
Maury


Top
 Profile  
 
 Post subject:
PostPosted: Sat Aug 11, 2007 9:19 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
I think he is asking about the Lucene search index...

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject: Re: How to disable automatic indexing after transaction comm
PostPosted: Mon Aug 13, 2007 10:39 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
eroy4u wrote:
I want to asynchronous update the index at regular time intervals, e.g. 1 time every day,
so I have to disable the automatic index after the transaction is committed, how can i do that?


Depends what you want to do:
- if you want to index changes made by hibernate but apply them only once a day, your best bet is to use the JMS back end. You just have to enable your Message Driven Bean to process the messages once a day. There is virtually no overhead in using this method for your front end.
- if you want to read data from the database and index what has changed once a day, you can implement a method that retrieve the appropriate data and run session.index(object) (check batch index in the doc). I expect to enhance this area in 3.1 (ie having the ability to do this automatic indexing for you)

But once again, unless the Db is updated behind Hibernate's back, 1 is preferable to 2, I think.

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 14, 2007 8:44 am 
Beginner
Beginner

Joined: Tue Aug 26, 2003 2:46 pm
Posts: 45
Location: Saskatoon SK Canada
christian wrote:
I think he is asking about the Lucene search index...


Ooops. Nevermind :)

_________________
Maury


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