I've just started seeing a problem in my application that's been working fine 
for months. While the rowId corresponds to the last inserted row, I'm getting 
it in a subsequent SELECT transaction.


db.transaction( function (tx) {
        var sql = "INSERT INTO responses (status, server) VALUES  ( ?, ?)";
        tx.executeSql( sql, [0, server]);       // insert a row, rowId=310;
        }
});

// later, in another function 

db.readTransaction( function (tx2) {
        var sql = "SELECT response FROM responses WHERE status = 200 AND server 
= ? ORDER BY DATE DESC LIMIT 1";
        var params = [server];
        var rs2 = tx2.executeSql(sql, params);
        console.log(blendSql(sql, params));
        console.debug("matched rows:", rs2.rows.length)
});

The blendSql() function prints my own version of the parameterized SQL just so 
I can dump it in a SQLite window. When I copy that output, I get a result, the 
result I expect.
But what is showing in the debugger is rs2 = {insertId: 310, rows: null, 
rowsAffected: 1} 

I'm at a loss on why this isn't working. These transactions aren't even 
concurrent.

_______________________________________________
Interest mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to