X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FStorage.pm;h=604ad5b7e8ed936799f5caaf2c35914dfd826fb4;hb=92bc2a19d5feb14139e092d697c103472f2ac6ed;hp=c8f48efc321ee4975bae7c94708fd92737183acc;hpb=360dc8a5c8fce8e2fac43970ef8a5e65ba1e5a16;p=dbsrgits%2FDBIx-Class-Historic.git diff --git a/lib/DBIx/Class/Storage.pm b/lib/DBIx/Class/Storage.pm index c8f48ef..604ad5b 100644 --- a/lib/DBIx/Class/Storage.pm +++ b/lib/DBIx/Class/Storage.pm @@ -299,9 +299,21 @@ sub svp_rollback { die "Virtual method!" } =for comment -=head2 txn_scope_guard +=head2 txn_scope_guard (EXPERIMENTAL) -Return an object that does stuff. +An alternative way of using transactions to C: + + my $txn = $storage->txn_scope_guard; + + $row->col1("val1"); + $row->update; + + $txn->commit; + +If a exception occurs, the transaction will be rolled back. This is still very +experiemental, and we are not 100% sure it is working right when nested. The +onus is on you as the user to make sure you dont forget to call +$C<$txn->commit>. =cut @@ -469,7 +481,8 @@ Old name for DBIC_TRACE =head1 SEE ALSO -L - reference storage inplementation using SQL::Abstract and DBI. +L - reference storage implementation using +SQL::Abstract and DBI. =head1 AUTHORS