use warnings;
use Scope::Guard ();
use Context::Preserve ();
+use Try::Tiny;
=head1 NAME
$sqltargs->{quote_table_names} = $quote_char ? 1 : 0;
$sqltargs->{quote_field_names} = $quote_char ? 1 : 0;
- my $oracle_version = eval { $self->_get_dbh->get_info(18) };
+ my $oracle_version = try { $self->_get_dbh->get_info(18) };
$sqltargs->{producer_args}{oracle_version} = $oracle_version;
local $dbh->{RaiseError} = 1;
local $dbh->{PrintError} = 0;
- eval {
+ my $rc = 1;
+ try {
$dbh->do('select 1 from dual');
+ } catch {
+ $rc = 0;
};
- return $@ ? 0 : 1;
+ return $rc;
}
sub _dbh_execute {
RETRY: {
do {
- eval {
+ my $exception;
+ try {
if ($wantarray) {
@res = $self->next::method(@_);
} else {
$res[0] = $self->next::method(@_);
}
+ } catch {
+ $exception = shift;
};
- $exception = $@;
if ($exception =~ /ORA-01003/) {
# ORA-01003: no statement parsed (someone changed the table somehow,
# invalidating your cursor.)