[freeside-commits] freeside/FS/FS cust_bill.pm,1.153,1.154

Jeff Finucane,420,, jeff at wavetail.420.am
Sun Aug 27 17:52:46 PDT 2006


Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail:/tmp/cvs-serv15768/FS/FS

Modified Files:
	cust_bill.pm 
Log Message:
protect against a race

Index: cust_bill.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_bill.pm,v
retrieving revision 1.153
retrieving revision 1.154
diff -u -d -r1.153 -r1.154
--- cust_bill.pm	27 Aug 2006 21:50:18 -0000	1.153
+++ cust_bill.pm	28 Aug 2006 00:52:44 -0000	1.154
@@ -1327,6 +1327,9 @@
   local $FS::UID::AutoCommit = 0;
   my $dbh = dbh;
 
+  $dbh->do("LOCK TABLE pay_batch IN SHARE ROW EXCLUSIVE MODE")
+    or return "Cannot lock pay_batch: " . $dbh->errstr;
+
   my $pay_batch = qsearchs('pay_batch', {'status' => 'O'});
 
   unless ( $pay_batch ) {



More information about the freeside-commits mailing list