From: Peter Rabbitson Date: Wed, 26 May 2010 10:17:55 +0000 (+0000) Subject: Really fix logic X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=87560ef9bfc9f2da040ab4d40a456735e3567847;p=dbsrgits%2FDBIx-Class-Historic.git Really fix logic --- diff --git a/lib/DBIx/Class/Storage/DBI/Oracle/Generic.pm b/lib/DBIx/Class/Storage/DBI/Oracle/Generic.pm index 9e72eae..68325bc 100644 --- a/lib/DBIx/Class/Storage/DBI/Oracle/Generic.pm +++ b/lib/DBIx/Class/Storage/DBI/Oracle/Generic.pm @@ -125,10 +125,10 @@ sub _dbh_execute { my $self = shift; my ($dbh, $op, $extra_bind, $ident, $bind_attributes, @args) = @_; - my (@res, $retried); + my (@res, $tried); my $wantarray = wantarray(); my $next = $self->next::can; - while (1) { + do { try { my $exec = sub { $self->$next($dbh, $op, $extra_bind, $ident, $bind_attributes, @args) }; @@ -141,9 +141,11 @@ sub _dbh_execute { else { @res = $exec->(); } + + $tried++; } catch { - if (!$retried++ and $_ =~ /ORA-01003/) { + if (! $tried and $_ =~ /ORA-01003/) { # ORA-01003: no statement parsed (someone changed the table somehow, # invalidating your cursor.) my ($sql, $bind) = $self->_prep_for_execute($op, $extra_bind, $ident, \@args); @@ -153,7 +155,7 @@ sub _dbh_execute { $self->throw_exception($_); } }; - } + } while (! $tried++); return $wantarray ? @res : $res[0]; }