Setting Error Handler
am 08.10.2006 02:20:31 von stbaldwin
Hi,
I'm using DBI 1.32 - which I realise is an old version, but it is the one
that (I believe) ships with RHEL3 and we have a policy of using supplied
rpm's wherever possible.
I'm trying to implement a mechanism where a DBI program can detect its DB
(Oracle in this case) session going away and attempts to recover from it.
Basically I have set up a custom error handler that checks for certain
Oracle errors (e.g. 3113, 3114, 28, 1012, ...) and if it finds one it
reconnects to the DB and re-initialises itself. This all works fine the
first time. The error handler does its thing and the program continues with
hardly a glitch.
If however the error occurs a second time, the custom error handler doesn't
kick in. I have made sure the error handler is re-established during the
re-initialisation. In fact the setting of the error handler is part of the
DB connect logic, so it gets executed both when the program starts, and when
the custom error handler detects the session needs to be re-established.
Can anyone tell me if this is a bug with the old version of DBI we are
using, or is still a bug, or it definitely works and must be something I'm
doing wrong.
Thanks,
Steve
RE: Setting Error Handler
am 09.10.2006 07:05:05 von stbaldwin
As you were. It was my screw-up. Everything is working as documented.
Sorry for the noise.
Steve
> -----Original Message-----
> From: Steve Baldwin [mailto:stbaldwin@multiservice.com]
> Sent: Sunday, 8 October 2006 10:21 AM
> To: dbi-users@perl.org
> Subject: Setting Error Handler
>
> Hi,
>
>
> I'm using DBI 1.32 - which I realise is an old version, but it is the one
> that (I believe) ships with RHEL3 and we have a policy of using supplied
> rpm's wherever possible.
>
>
> I'm trying to implement a mechanism where a DBI program can detect its DB
> (Oracle in this case) session going away and attempts to recover from it.
> Basically I have set up a custom error handler that checks for certain
> Oracle errors (e.g. 3113, 3114, 28, 1012, ...) and if it finds one it
> reconnects to the DB and re-initialises itself. This all works fine the
> first time. The error handler does its thing and the program continues
> with
> hardly a glitch.
>
> If however the error occurs a second time, the custom error handler
> doesn't
> kick in. I have made sure the error handler is re-established during the
> re-initialisation. In fact the setting of the error handler is part of
> the
> DB connect logic, so it gets executed both when the program starts, and
> when
> the custom error handler detects the session needs to be re-established.
>
> Can anyone tell me if this is a bug with the old version of DBI we are
> using, or is still a bug, or it definitely works and must be something I'm
> doing wrong.
>
> Thanks,
>
> Steve
>