cleverett has asked for the wisdom of the Perl Monks concerning the following question:

My employer is upgrading the Oracle DB to RAC. TAF will be enabled.

I'm pretty clear on how to handle TAF events by supplying a callback function.

What I'm not clear on, is what to do after reconnection. I've figured out a way of replaying all the DB requests that came through before the DB failure. But that could easily go south if a sequence or intermediate query result changes between the time DBI disconnects and reconnects.

Our environment is unfortunately primitive. We run mod_perl, but we don't do handlers; we have CGI scripts that we very slightly modified to run with reliably with PerlResponseHandler ModPerl::PerlRun.

What I'd really like to do, is simply roll back the changes and start the response handler (PerlRun) over again as if it had never run in the first place. I'm just not sure what general approach to take to get that result. I'm thinking that I could create a specific exception class, and use that to tell a class inheriting from ModPerl::PerlRun to start the request over, and use that class instead of ModPerl::PerlRun for the response handler.

I'm not looking for code, just a clue that what I want to do isn't crazy and/or pointers to something simple that would work reliably.

  • Comment on Seamless recovery from DB disconnects in Apache/mod_perl

Replies are listed 'Best First'.
Re: Seamless recovery from DB disconnects in Apache/mod_perl
by hippo (Archbishop) on Oct 13, 2017 at 16:17 UTC
    I'm not looking for code, just a clue that what I want to do isn't crazy

    It doesn't sound crazy to me given that you don't want to alter your scripts. Nor does it sound particularly tricky to put together a proof of concept. Give it a spin and report back either way. Good luck.

Re: Seamless recovery from DB disconnects in Apache/mod_perl
by Anonymous Monk on Oct 12, 2017 at 21:33 UTC
    How often will the disconnets happen? Why can't you just return an error to the client when they do?
      We have a business need to make DB failover transparent to users.