local $self->{_in_dbh_do} = 1;
my @args = @_;
- try {
- return $self->$code ($dbh, @args);
+ return try {
+ $self->$code ($dbh, @args);
} catch {
$self->throw_exception($_) if $self->connected;
my $self = shift;
my ($dbh, $op, $extra_bind, $ident, $bind_attributes, @args) = @_;
- my $retried;
+ my (@res, $retried);
+ my $wantarray = wantarray();
my $next = $self->next::can;
while (1) {
try {
- return $self->$next($dbh, $op, $extra_bind, $ident, $bind_attributes, @args);
+ my $exec = sub { $self->$next($dbh, $op, $extra_bind, $ident, $bind_attributes, @args) };
+
+ if (!defined $wantarray) {
+ $exec->();
+ }
+ elsif (! $wantarray) {
+ $res[0] = $exec->();
+ }
+ else {
+ @res = $exec->();
+ }
}
catch {
if (!$retried++ and $_ =~ /ORA-01003/) {
}
};
}
+
+ return $wantarray ? @res : $res[0];
}
=head2 get_autoinc_seq