[Bast-commits] r3280 - branches/DBIx-Class-current/lib/DBIx/Class

blblack at dev.catalyst.perl.org blblack at dev.catalyst.perl.org
Thu May 10 22:13:16 GMT 2007


Author: blblack
Date: 2007-05-10 22:13:14 +0100 (Thu, 10 May 2007)
New Revision: 3280

Modified:
   branches/DBIx-Class-current/lib/DBIx/Class/Storage.pm
Log:
docs about side-effects in txn_do coderef

Modified: branches/DBIx-Class-current/lib/DBIx/Class/Storage.pm
===================================================================
--- branches/DBIx-Class-current/lib/DBIx/Class/Storage.pm	2007-05-10 21:11:04 UTC (rev 3279)
+++ branches/DBIx-Class-current/lib/DBIx/Class/Storage.pm	2007-05-10 21:13:14 UTC (rev 3280)
@@ -169,6 +169,15 @@
 the outermost transaction will issue a L</txn_commit>, and txn_do() can be
 called in void, scalar and list context and it will behave as expected.
 
+Please note that all of the code in your coderef, including non-DBIx::Class
+code, is part of a transaction.  This transaction may fail out halfway, or
+it may get partially double-executed (in the case that our DB connection
+failed halfway through the transaction, in which case we reconnect and
+restart the txn).  Therefore it is best that any side-effects in your coderef
+are idempotent (that is, can be re-executed multiple times and get the
+same result), and that you check up on your side-effects in the case of
+transaction failure.
+
 =cut
 
 sub txn_do {




More information about the Bast-commits mailing list