-->
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: Hibernate Search: error handling for automatic index updates
PostPosted: Sun Apr 10, 2011 10:37 am 
Beginner
Beginner

Joined: Tue May 11, 2004 12:20 am
Posts: 33
Hi,

I plan to use Hibernate Search, hopefully with automatic "transparent" index updates (automatically on session commit, without explicit coding).
I just wonder how it handles errors (e.g. on the file system, database connection, etc):

1) Does it issue some event/notification, which I can catch (so I can send email to admin, issue some GUI message, etc)?

2) Can it be configured to re-try (e.g. tell it "if you run into an error, try again every 10 minutes, up to 5 attempts, before you give up").

3) Do the replies above change if I configure changes to be asynchrnous?
Do the replies above change if I configure Hibernate Search to use JMS?

Thanks :)


Top
 Profile  
 
 Post subject: Re: Hibernate Search: error handling for automatic index updates
PostPosted: Sun Apr 10, 2011 5:39 pm 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Hi, welcome
Quote:
1) Does it issue some event/notification, which I can catch (so I can send email to admin, issue some GUI message, etc)?

yes, all operations related to event styled indexing can have a custom evenhandler registered:
http://docs.jboss.org/hibernate/search/ ... e/#d0e2226
This is only relevant to indexing operations, stuff like you mention to "open a database connection" is normal hibernate business: so it's hibernate which might throw runtime exceptions to your application. The additional custom eventhandler in search is neede because some work is possibly performed in other threads than your application.

Quote:
2) Can it be configured to re-try (e.g. tell it "if you run into an error, try again every 10 minutes, up to 5 attempts, before you give up").

No. Why? all operations to the index are put in the "todo" queue upon a succesfull commit to the database, it's a transaction sync. It's unlikely but possible that operations fail after this queue, for this case the eventhandler mentioned above will be notified and you can handle it ad you wish. The most common failure case would be "disk crashed" or "disk is full", so a retry operation doesn't make sense before the admin does something. In this cases you usually perform a full reindexing the get the index in synch with the db state - we always consider the db as the reliable source of information.

Quote:
3) Do the replies above change if I configure changes to be asynchrnous?

No, same strategies.
Quote:
Do the replies above change if I configure Hibernate Search to use JMS?

using JMS you can make sure that the backend queue is eventually fully processed, it's up to you to code the receiver so you could configure JMS to not consider a message processed if you can't invoke the Search backends without received errors.

_________________
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.