X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FStorage%2FDBI.pm;h=527c2fb9acceca6f5a570eaa96228a6762a6c192;hb=8f6986ac3a13c85fbbf0f783f47daf9304a409e1;hp=d46522b307f19d0e7954ebbae24769fd942d7910;hpb=5cbe5b1216f07b5e329f493bd8bdfa5b0aa0f5eb;p=dbsrgits%2FDBIx-Class-Historic.git diff --git a/lib/DBIx/Class/Storage/DBI.pm b/lib/DBIx/Class/Storage/DBI.pm index d46522b..527c2fb 100644 --- a/lib/DBIx/Class/Storage/DBI.pm +++ b/lib/DBIx/Class/Storage/DBI.pm @@ -793,25 +793,14 @@ sub dbh_do { return $self->$run_target($self->_get_dbh, @_) if $self->{_in_do_block} or $self->transaction_depth; - my $cref = (ref $run_target eq 'CODE') - ? $run_target - : $self->can($run_target) || $self->throw_exception(sprintf ( - 'Can\'t locate object method "%s" via package "%s"', - $run_target, - (ref $self || $self), - )) - ; - # 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) my $args = @_ ? \@_ : []; - unshift @$args, $self, $self->_get_dbh; DBIx::Class::Storage::BlockRunner->new( storage => $self, - run_code => $cref, - run_args => $args, + run_code => sub { $self->$run_target ($self->_get_dbh, @$args ) }, wrap_txn => 0, retry_handler => sub { ! ( $_[0]->retried_count or $_[0]->storage->connected ) }, )->run;