]> granicus.if.org Git - pdns/commitdiff
Use transaction when updating serial
authorAki Tuomi <cmouse@desteem.org>
Tue, 14 Oct 2014 07:27:06 +0000 (10:27 +0300)
committerAki Tuomi <cmouse@desteem.org>
Tue, 14 Oct 2014 07:27:06 +0000 (10:27 +0300)
pdns/pdnssec.cc

index 24342e2c238ffbe0dcce09868d938ab7b3ce1d48..f486f2c5201d1b1b80b6a81e667ac0a6077812f3 100644 (file)
@@ -612,7 +612,10 @@ int increaseSerial(const string& zone, DNSSECKeeper &dk)
   }
   rrs[0].content = serializeSOAData(sd);
 
+  sd.db->startTransaction("", -1);
+
   if (! sd.db->replaceRRSet(sd.domain_id, zone, rr.qtype, rrs)) {
+   sd.db->abortTransaction();
    cerr<<"Backend did not replace SOA record. Backend might not support this operation."<<endl;
    return -1;
   }
@@ -638,6 +641,8 @@ int increaseSerial(const string& zone, DNSSECKeeper &dk)
     }
   }
 
+  sd.db->commitTransaction();
+
   cout<<"SOA serial for zone "<<zone<<" set to "<<sd.serial<<endl;
   return 0;
 }