Index: trunk/cgi-bin/main.cgi
===================================================================
--- trunk/cgi-bin/main.cgi	(revision 62)
+++ trunk/cgi-bin/main.cgi	(revision 63)
@@ -118,6 +118,4 @@
     $sth = $ip_dbh->prepare("insert into masterblocks values ('$webvar{cidr}')");
     $sth->execute;
-# Don't need this with RaiseError, but leave it for now.
-#    croak $sth->errstr if ($sth->errstr());
 
 # Unrouted blocks aren't associated with a city (yet).  We don't rely on this
@@ -128,6 +126,4 @@
 	$cidr->masklen.",'<NULL>','n')");
     $sth->execute;
-# Don't need this with RaiseError, but leave it for now.
-#    croak $sth->errstr if ($sth->errstr());
 
     # If we get here, everything is happy.  Commit changes.
@@ -998,7 +994,8 @@
 # Allow transactions, and make errors much easier to catch.
 # Much as I would like to error-track specifically on each ->execute,
-# that's a LOT of code.  :/
-    $ip_dbh->{AutoCommit} = 0;
-    $ip_dbh->{RaiseError} = 1;
+# that's a LOT of code, and some SQL blocks MUST be atomic at a
+# multi-statement level.  :/
+    local $ip_dbh->{AutoCommit} = 0;	# These need to be local so we don't
+    local $ip_dbh->{RaiseError} = 1;	# step on our toes by accident.
 
     if ($webvar{fullcidr} eq $webvar{alloc_from}) {
@@ -1133,8 +1130,4 @@
     syslog "notice", "$full_alloc_types{$webvar{alloctype}} '$webvar{fullcidr}' successfully initialized by $authuser";
 
-    # Turn off transactions and exception-on-error'ing
-    $ip_dbh->{AutoCommit} = 0;
-    $ip_dbh->{RaiseError} = 1;
-
     print qq(<div class="center"><div class="heading">The block $webvar{fullcidr} was sucessfully added as type '$webvar{alloctype}' ($full_alloc_types{$webvar{alloctype}})</div></div>);
 
