WebSQL don't rollback
<p>Check this example:</p>

<pre><code>var db = openDatabase( 'test.db', 1, '', 2*1024*1024 );

db.transaction(function(tx) { 
    var success = function(tx,results) {
        console.log( results );
    };
    var error = function(tx,results) {
        console.log( results );
    };
    // clean previous state
    tx.executeSql( 'DROP TABLE IF EXISTS products', [], success, error );
    tx.executeSql( 'CREATE TABLE products ( id INTEGER NULL PRIMARY KEY, name TEXT )', [], success, error );
    tx.executeSql( 'CREATE UNIQUE INDEX name ON products( name )', [], success, error );
    tx.executeSql( 'INSERT INTO products( name ) VALUES ( "Lechuga" )', [], success, error );
    tx.executeSql( 'INSERT INTO products( name ) VALUES ( "Naranja" )', [], success, error );
    tx.executeSql( 'INSERT INTO products( name ) VALUES ( "Naranja" )', [], success, error );
    tx.executeSql( 'INSERT INTO products( name ) VALUES ( "Tomate" )', [], getAll, error );
} );

function getAll(tx, results) {
    db.transaction(function(tx) {
        tx.executeSql( 'SELECT * FROM products', [], function(tx, results) {
            console.assert( results.rows.length === 0 ) // false, why?
        } );
    } );
}
</code></pre>

<p>jsfiddle link: <a href="http://jsfiddle.net/aBx7E/6/" rel="nofollow">http://jsfiddle.net/aBx7E/6/</a></p>

<p>The insert query that trigger the unique constraint, don't stop to keep websql continuing executing the next query.
So at the end of the process you will have 4 rows, that is non sense, because if I am under transaction, when the constraint error is triggered, all the previous changes over the table are discarded.</p>

<p>Why Websql don't triger the rollback mechanism?</p>
