X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FStorage.pm;h=d72840fc50edd00fe9ffed84b2e6924a63372336;hb=a807d012;hp=e317d1f137a3a8c5776bcfa654dcd4174fca0c75;hpb=528e717e3715d0f68e790542306161612cae4fef;p=dbsrgits%2FDBIx-Class-Historic.git diff --git a/lib/DBIx/Class/Storage.pm b/lib/DBIx/Class/Storage.pm index e317d1f..d72840f 100644 --- a/lib/DBIx/Class/Storage.pm +++ b/lib/DBIx/Class/Storage.pm @@ -460,27 +460,29 @@ sub svp_rollback { $exec->($self, $name); } -=for comment +=begin comment -=head2 txn_scope_guard + =head2 txn_scope_guard -An alternative way of transaction handling based on -L: + An alternative way of transaction handling based on + L: - my $txn_guard = $storage->txn_scope_guard; + my $txn_guard = $storage->txn_scope_guard; - $row->col1("val1"); - $row->update; + $row->col1("val1"); + $row->update; - $txn_guard->commit; + $txn_guard->commit; -If an exception occurs, or the guard object otherwise leaves the scope -before C<< $txn_guard->commit >> is called, the transaction will be rolled -back by an explicit L call. In essence this is akin to -using a L/L pair, without having to worry -about calling L at the right places. Note that since there -is no defined code closure, there will be no retries and other magic upon -database disconnection. If you need such functionality see L. + If an exception occurs, or the guard object otherwise leaves the scope + before C<< $txn_guard->commit >> is called, the transaction will be rolled + back by an explicit L call. In essence this is akin to + using a L/L pair, without having to worry + about calling L at the right places. Note that since there + is no defined code closure, there will be no retries and other magic upon + database disconnection. If you need such functionality see L. + +=end comment =cut