Using ErrorHandler - 04-14-2006 , 02:01 PM
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
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
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.