sqlite3-transactions
sqlite3-transactions copied to clipboard
no rollback is performed on error
Running this on a nwjs-compiled sqlite3 in nwjs
db.run ("CREATE TABLE `test` (`index` INTEGER) PRIMARY KEY(`INTEGER`);");
db.beginTransaction(function(err, transaction) {
transaction.run("INSERT ..."); //left this in by accident and even this did not trigger a rollback
for (var i = 0; i < 3; i++) {
transaction.run("INSERT INTO `test` VALUES (1);");
}
transaction.commit(function(err) {
if (err) return console.log("Sad panda :-( commit() failed.", err);
console.log("Happy panda :-) commit() was successful.");
});
});