Fellow DBIers,
When I wrote DBIx::Connector, I borrowed this code from DBIx::Class to “work
around an issue”:
sub ping {
my ($self, $dbh) = @_;
eval {
local $dbh->{RaiseError} = 1;
$dbh->do('select 1 from dual');
};
return $@ ? 0 : 1;
}
The reason for this workaround is described in [this
comment](https://rt.cpan.org/Ticket/Display.html?id=47005#txn-808055) from
Peter Rabbitison:
> DBD::Oracle has some shutdown state in which it will return 1 on ping as long
> as the socket is still open. This however did not guarantee the server is any
> longer in a state to execute
> queries. So what happened was:
>
> 1) the weird state is reached
> 2) a txn_do takes place and fails on the first sql command
> 3) the code calls ping() and gets a connected reply
> 4) the txn_do is not retried
> 5) ...
> 6) users lose profit
So a few questions about this:
1. Was this issue reported somewhere?
2. If so, was it fixed or otherwise worked around?
3. And if it was fixed, in what version of DBD::Oracle?
Thanks,
David