Can somebody please explain me the error message my ionic / cordova app is returning when writing to an already open SQLite DB?
A READ request before the write to the DB fine, but writing fails…
[Log] {"db":{"openargs":{"name":"mydb.db","dblocation":"docs"},"dbname":"mydb.db"},"txlock":true,"readOnly":false,"executes":[],"finalized":true} (console-via-logger.js, line 174)
This is what SQLite outputs before I run the write transaction:
[Log] OPEN database: mydb.db (console-via-logger.js, line 174)
[Log] new transaction is waiting for open operation (console-via-logger.js, line 174)
[Log] DB opened: mydb.db (console-via-logger.js, line 174)
That’s how I write to it
myDB.transaction(function(transaction) {
var query = "UPDATE Data SET Values='"+dataJSON+"'";
// console.log(query);
transaction.executeSql(query,[],
//On Success
function(tx, result) {
// console.log('UPDATE SUCCESSFULLY');
deferred.resolve(true);
},
//On Error
function(error){
// console.log('Backing up data to DB failed');
deferred.reject(error);
});
});