freeside/FS/FS svc_acct.pm,1.109.2.45,1.109.2.46
ivan
ivan at pouncequick.420.am
Sun Sep 5 02:41:37 PDT 2004
Update of /home/cvs/cvsroot/freeside/FS/FS
In directory pouncequick:/tmp/cvs-serv21932
Modified Files:
Tag: FREESIDE_1_4_BRANCH
svc_acct.pm
Log Message:
acquire a database lock to prevent race conditions in duplicate checking
Index: svc_acct.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/svc_acct.pm,v
retrieving revision 1.109.2.45
retrieving revision 1.109.2.46
diff -u -d -r1.109.2.45 -r1.109.2.46
--- svc_acct.pm 14 Aug 2004 12:26:59 -0000 1.109.2.45
+++ svc_acct.pm 5 Sep 2004 09:41:35 -0000 1.109.2.46
@@ -251,6 +251,13 @@
#new duplicate username/username at 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;
More information about the freeside-commits
mailing list