X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fsvc_acct.pm;h=da3571e620c4d1eac618be1afb4ffa7e0c096561;hb=1555a620f8f05ba8f3bccba6ec5f559752bbef5d;hp=806e793eafd67bf06aa528a6e53459388d984858;hpb=0c2698a4bccee998a62c5a12d61dd594453f3f21;p=freeside.git diff --git a/FS/FS/svc_acct.pm b/FS/FS/svc_acct.pm index 806e793ea..da3571e62 100644 --- a/FS/FS/svc_acct.pm +++ b/FS/FS/svc_acct.pm @@ -251,6 +251,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;