[Bast-commits] r4581 - DBIx-Class/0.08/trunk/lib/DBIx/Class

ash at dev.catalyst.perl.org ash at dev.catalyst.perl.org
Wed Jul 16 17:41:52 BST 2008


Author: ash
Date: 2008-07-16 17:41:52 +0100 (Wed, 16 Jul 2008)
New Revision: 4581

Modified:
   DBIx-Class/0.08/trunk/lib/DBIx/Class/Schema.pm
   DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage.pm
Log:
Update docs re txn_scope_guard

Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class/Schema.pm
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class/Schema.pm	2008-07-16 16:35:53 UTC (rev 4580)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class/Schema.pm	2008-07-16 16:41:52 UTC (rev 4581)
@@ -721,9 +721,10 @@
   $self->storage->txn_do(@_);
 }
 
-=head2 txn_scope_guard
+=head2 txn_scope_guard (EXPERIMENTAL)
 
-Runs C<txn_scope_guard> on the schema's storage.
+Runs C<txn_scope_guard> on the schema's storage. See 
+L<DBIx::Class::Storage/txn_scope_guard>.
 
 =cut
 

Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage.pm
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage.pm	2008-07-16 16:35:53 UTC (rev 4580)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage.pm	2008-07-16 16:41:52 UTC (rev 4581)
@@ -299,10 +299,22 @@
 
 =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<txn_do>:
 
+ 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
 
 sub txn_scope_guard {




More information about the Bast-commits mailing list