Suppress SQL errors in two cases where they are normal.

This commit is contained in:
JoelKatz
2012-06-18 10:30:10 -07:00
parent 36b829f003
commit 7e286839bb
2 changed files with 3 additions and 2 deletions

View File

@@ -292,7 +292,7 @@ void Ledger::saveAcceptedLedger(Ledger::pointer ledger)
}
sql += ";";
Log(lsTRACE) << "ActTx: " << sql;
db->executeSQL(sql);
db->executeSQL(sql, true); // may already be in there
if (!db->executeSQL(
txn.getSQLInsertHeader() + txn.getSQL(ledger->getLedgerSeq(), TXN_SQL_VALIDATED) + ";"), true)
{ // transaction already in DB, update

View File

@@ -525,7 +525,8 @@ bool Transaction::save()
Database *db = theApp->getTxnDB()->getDB();
ScopedLock dbLock = theApp->getTxnDB()->getDBLock();
return db->executeSQL(mTransaction->getSQLInsertHeader() + mTransaction->getSQL(getLedger(), status) + ";");
return
db->executeSQL(mTransaction->getSQLInsertHeader() + mTransaction->getSQL(getLedger(), status) + ";", true);
}
Transaction::pointer Transaction::transactionFromSQL(const std::string& sql)