my %opt = @_;
my $oldAutoCommit = $FS::UID::AutoCommit;
- $FS::UID::AutoCommit = 0;
+ local $FS::UID::AutoCommit = 0;
my $dbh = dbh;
my $conf = FS::Conf->new;
my $taxname = $conf->config('tax_district_taxname') || '';
+ FS::cust_main_county->lock_table;
if ($method eq 'wa_sales') {
# download the update file
my $now = DateTime->now;