X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FStorage%2FDBI%2FOracle%2FGeneric.pm;h=9e72eae2273063c6c7e8a3c6ddf27eaddd5cca2d;hb=dd415de8014e0461d73eb092089b1f51dc894884;hp=f3b178e9f71d1c5eceeb5be281f203baf7d225d8;hpb=66efa982f30b374c3c12d1b01535c766a2e6e426;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/Storage/DBI/Oracle/Generic.pm b/lib/DBIx/Class/Storage/DBI/Oracle/Generic.pm index f3b178e..9e72eae 100644 --- a/lib/DBIx/Class/Storage/DBI/Oracle/Generic.pm +++ b/lib/DBIx/Class/Storage/DBI/Oracle/Generic.pm @@ -125,11 +125,22 @@ sub _dbh_execute { 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/) { @@ -143,6 +154,8 @@ sub _dbh_execute { } }; } + + return $wantarray ? @res : $res[0]; } =head2 get_autoinc_seq