title: Problems with db.transaction on phonegap
body: <p>I have a function that save some data to my database and all worked fine on cordova 2.4, but I upgraded to cordova 2.6 and I started to have some issues with my database, it becames slow and start to have some problems with callbacks.</p>
  
  <p><strong>My first problem</strong> is that the callback given to db.transaction fires when I call tx.executeSql</p>
  
  <pre><code>function populateDB(tx) {
       tx.executeSql('DROP TABLE IF EXISTS DEMO'); /* &lt;-- succesCB is fired */
       tx.executeSql('CREATE TABLE IF NOT EXISTS DEMO (id unique, data)'); /* &lt;-- succesCB is fired again */
       tx.executeSql('INSERT INTO DEMO (id, data) VALUES (1, "First row")'); /* &lt;-- succesCB is fired again */
       tx.executeSql('INSERT INTO DEMO (id, data) VALUES (2, "Second row")'); /* &lt;-- succesCB is fired again */
  }
  
  function errorCB(err) {
      alert("Error processing SQL: "+err.code);
  }
  
  function successCB() {
      alert("success!");
  }
  
  var db = window.openDatabase("Database", "1.0", "Cordova Demo", 200000);
  db.transaction(populateDB, errorCB, successCB);
  </code></pre>
  
  <p>Before the upgrade it was fired at the end of the transaction function (in this case populateDB), on chrome is fired at the end too.</p>
  
  <p>Wich is the right behavior? Fired on executeSql or at the end of populateDB ?</p>
  
  <p>I have the same behavior on Galaxy S2 (4.1.2), Asus Transformer TF101 (4.0.3), Galaxy Tab (4.0.4)</p>
  
  <p>My second problem is that when I'm inserting all my data it take ages, about 5min for 13 000 records I have tried to insert values like <code>INSERT INTO mytable (id, x) VALUES (1, "sas"), (2, "dsfdsf"), ...</code> and it was much faster, but it only works when using sqlite >= 3.7.11, so I tried the UNION SELECT pattern but is really slow.</p>
  
  <p>some ideas?</p>