dbTalk Databases Forums  

Using ErrorHandler

comp.databases.berkeley-db comp.databases.berkeley-db


Discuss Using ErrorHandler in the comp.databases.berkeley-db forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Phantom
 
Posts: n/a

Default Using ErrorHandler - 04-14-2006 , 02:01 PM






Hi All

There are situations in which I get the following two exceptions which
read as "Secondary Index is bad" and "Unable to allocate memory for
transaction". Although the former is a bug in our software and ofcourse
needs to be addressed it is not as catastrophic as the later. I also
have an error handler register which gets called for these two
exceptions with a NULL prefix.

I want to react to the later problem in the error handler by closing
and reopening the database handles and ignore the former exception. How
can I switch between the two w/o switching on the error message string
? Is there anyway to handle this in a better fashion. This is using the
Java API.

Please advice.

A


Reply With Quote
  #2  
Old   
Alex
 
Posts: n/a

Default Re: Using ErrorHandler - 04-17-2006 , 08:51 PM






The short answer is that the string in the exception is the uniquely
identifying component in the DatabaseException object. Unless you are
able to use and make sense of the errno (via getErrno) on your platform
in the memory allocation failure case.

If you are receiving the error handler callback, and are handling the
cleanup there - why are you still wanting to switch within the
exception handler?

As for the NULL prefix - are you calling setErrorPrefix on the Databse
config? If so, this sounds like a bug, if you could provide a code
sample demonstrating the problem I will investigate further.

- Alex


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.