X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FStorage.pm;h=5cc1fe179f82e2aed283c5ebb28d4bada5c35d13;hb=7d534e689b7f9820dda4272bf6702fc3e9e86f0d;hp=470911b4fb9a837aa8246d3bc573874ab89dad62;hpb=6ae62c5c162c519053b7354065b8f6c33e990b6e;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/Storage.pm b/lib/DBIx/Class/Storage.pm index 470911b..5cc1fe1 100644 --- a/lib/DBIx/Class/Storage.pm +++ b/lib/DBIx/Class/Storage.pm @@ -175,18 +175,16 @@ transaction failure. sub txn_do { my $self = shift; - my $coderef = shift; DBIx::Class::Storage::BlockRunner->new( storage => $self, - run_code => $coderef, - run_args => @_ - ? \@_ # take a ref instead of a copy, to preserve @_ aliasing - : [] # semantics within the coderef, but only if needed - , # (pseudoforking doesn't like this trick much) wrap_txn => 1, - retry_handler => sub { ! ( $_[0]->retried_count or $_[0]->storage->connected ) }, - )->run; + retry_handler => sub { + $_[0]->failed_attempt_count == 1 + and + ! $_[0]->storage->connected + }, + )->run(@_); } =head2 txn_begin