From: John Napiorkowski Date: Wed, 4 Jun 2008 17:49:15 +0000 (+0000) Subject: fixed boneheaded failure to properly propogate txn_do X-Git-Tag: v0.08240~402^2~24 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=6834cc1d0449dfc1f528a1b9ecaf4f1a98ae0794;p=dbsrgits%2FDBIx-Class.git fixed boneheaded failure to properly propogate txn_do --- diff --git a/lib/DBIx/Class/Storage/DBI/Replicated.pm b/lib/DBIx/Class/Storage/DBI/Replicated.pm index 0846f85..a21c413 100644 --- a/lib/DBIx/Class/Storage/DBI/Replicated.pm +++ b/lib/DBIx/Class/Storage/DBI/Replicated.pm @@ -224,6 +224,7 @@ has 'write_handler' => ( update delete dbh + txn_do txn_commit txn_rollback sth @@ -470,7 +471,7 @@ sub set_balanced_storage { $schema->storage->read_handler($write_handler); } -=head2 txn_do ($coderef) +=head2 around: txn_do ($coderef) Overload to the txn_do method, which is delegated to whatever the L is set to. We overload this in order to wrap in inside a @@ -478,10 +479,10 @@ L method. =cut -sub txn_do { - my($self, $coderef, @args) = @_; - $self->execute_reliably($coderef, @args); -} +around 'txn_do' => sub { + my($txn_do, $self, $coderef, @args) = @_; + $self->execute_reliably(sub {$self->$txn_do($coderef, @args)}); +}; =head2 reload_row ($row)