On Oct 31, 2007, at 4:56 PM, Ian Hickson wrote:
The fear is that people would do:
db.executeSql('...', [], function(...) {
db.executeSql('...', []); // depends on the first call
});
...without a transaction.
How is that wrong? If the first executeSql fails the error callback
(if any) will fire, not the normal callback.
db.executeSql('CREATE TABLE ...', [], function(...) {
db.executeSql('INSERT INTO ...', []);
});
If the CREATE TABLE fails, the insert will never happen. If the INSERT
fails, you don't really want the table to be rolled out. If you did,
then you want a transaction. There are clearly times where you don't
always want a transaction, but want to chain statements.
— Timothy Hatcher