use warnings;
use Scope::Guard ();
use Context::Preserve ();
+use Try::Tiny;
=head1 NAME
my $dbh = $self->_dbh or return 0;
local $dbh->{RaiseError} = 1;
+ local $dbh->{PrintError} = 0;
- eval {
- $dbh->do("select 1 from dual");
+ 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.)
$self->throw_exception($exception) if $exception;
- wantarray ? @res : $res[0]
+ $wantarray ? @res : $res[0]
}
=head2 get_autoinc_seq
on_connect_call => 'datetime_setup'
-In L<DBIx::Class::Storage::DBI/connect_info> to set the session nls date, and
-timestamp values for use with L<DBIx::Class::InflateColumn::DateTime> and the
-necessary environment variables for L<DateTime::Format::Oracle>, which is used
-by it.
+In L<connect_info|DBIx::Class::Storage::DBI/connect_info> to set the session nls
+date, and timestamp values for use with L<DBIx::Class::InflateColumn::DateTime>
+and the necessary environment variables for L<DateTime::Format::Oracle>, which
+is used by it.
Maximum allowable precision is used, unless the environment variables have
already been set.