diff options
author | jeff <jeff> | 2006-08-28 00:52:44 +0000 |
---|---|---|
committer | jeff <jeff> | 2006-08-28 00:52:44 +0000 |
commit | f43c7c5765db18b35a3d3bec837681725bf0c245 (patch) | |
tree | e53ac4f930b3afac1ceb51337707d852542d3220 /FS | |
parent | e328ac561e5f8ba6fdb54f9d04c8b237993bdeb3 (diff) |
protect against a race
Diffstat (limited to 'FS')
-rw-r--r-- | FS/FS/cust_bill.pm | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/FS/FS/cust_bill.pm b/FS/FS/cust_bill.pm index 1801b125f..e1281e372 100644 --- a/FS/FS/cust_bill.pm +++ b/FS/FS/cust_bill.pm @@ -1327,6 +1327,9 @@ sub batch_card { 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 ) { |