I am new to the phonegap and Sqlite development. My requirement is to undo a transaction or multiple transactions.
Can I use SAVEPOINT to achieve this? Here is the pseudo code. .
db.transaction(function (transaction) {
transaction.executeSql('SAVEPOINT XXX;',
[],
nullHandler,
errorHandler);
});
db.transaction(function (transaction) {
transaction.executeSql('INSERT INTO .....;',
[],
nullHandler,
errorHandler);
});
db.transaction(function (transaction) {
transaction.executeSql('RELEASE XXX;',
[],
nullHandler,
errorHandler);
});
I also ready SAVEPOINT is only within a transaction. Does anyone of you have any ideas of how to implement this? If not I need to revamp my whole Data model to account for this requirement.