X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2Fsvc_acct.pm;h=ded796ff73da94d6fa2f0c6a1251f559f99713ee;hp=f935df50d0b6495fb4b04ace610b891db67c74e7;hb=c63c48cc357aecdd1a584e4102e7cfff74702229;hpb=47d18732ecb7f43fbed2c8f94226c509fe887a53 diff --git a/FS/FS/svc_acct.pm b/FS/FS/svc_acct.pm index f935df50d..ded796ff7 100644 --- a/FS/FS/svc_acct.pm +++ b/FS/FS/svc_acct.pm @@ -247,6 +247,13 @@ sub insert { #new duplicate username/username@domain/uid checking + #this is Pg-specific. what to do for mysql etc? + # ( mysql LOCK TABLES certainly isn't equivalent or useful here :/ ) + warn "$me locking svc_acct table for duplicate search" if $DEBUG; + dbh->do("LOCK TABLE svc_acct IN SHARE ROW EXCLUSIVE MODE") + or die dbh->errstr; + warn "$me acquired svc_acct table lock for duplicate search" if $DEBUG; + my $part_svc = qsearchs('part_svc', { 'svcpart' => $self->svcpart } ); unless ( $part_svc ) { $dbh->rollback if $oldAutoCommit;