title: IndexedDB transaction always throwing onabort from add() method in Chrome
body: <p>I just started experimenting with IndexedDB.  I copied an example and pared it down to a small HTML page:   Push a button; add a record; dump all the records to the console after the transaction completes.</p>
  
  <p>It runs fine in IE11, but not on Chrome.  </p>
  
  <p>The request=transaction.objectstore("store").add({k:v})is always executing the request.onsuccess() method, but the transaction is always resolved with transaction.onabort() by Chrome.   Same with .put().</p>
  
  <p>This is the code:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;script&gt;
      //--- globals 
      var db;
  
      // The initialization of our stuff in body.onload()
      function init() {
          var dbVersion = 1;
  
          //--- Try to delete any existing database
          var delRequest = indexedDB.deleteDatabase("notesDB");
          delRequest.onsuccess = function (de) {
              dbOpen(); // .... then open a new one
          };
  
          delRequest.onerror = function (de) {
              dbOpen(); // ... or open a new one if one doesn't exist to delete
          };
  
          function dbOpen () {
              var openRequest = indexedDB.open("notesDB", dbVersion);
  
              openRequest.onupgradeneeded = function (e) {
                  var ldb = e.target.result;
                  console.log("running onupgradeneeded; always start with a fresh object store");
                  if (ldb.objectStoreNames.contains("note")) {
                      ldb.deleteObjectStore("note");
                  }
                  if (!ldb.objectStoreNames.contains("note")) {
                      console.log("creating new note data store");
                      var objectStore = ldb.createObjectStore("note", { autoIncrement: true });
                      objectStore.createIndex("title", "title", { unique: false });
                  }
              };
  
              openRequest.onsuccess = function (e) {
                  db = e.target.result;
  
                  db.onerror = function (event) {
                      // Generic error handler for all errors targeted at this database
                      alert("Database error: " + event.target.errorCode);
                      console.dir(event.target);
                  };
                  console.log("Database opened; dump existing rows (shouldn't be any)");
                  displayNotes();
              };
  
              openRequest.onerror = function (e) {
                  console.log("Open error");
                  console.log(e);
                  console.dir(e);
              };
          }
  
          function displayNotes() {
              console.log("TODO - print something nice on the page");
              var tx = db.transaction("note", "readonly");
              tx.oncomplete = function (event) { console.log("read only cursor transaction complete"); }
              tx.onerror = function (event) { console.log("readonly transaction onerror"); }
              tx.onabort = function (event) { console.log("readonly transaction onabort"); }
  
              // --- iterate cursor
              console.log("---Start cursor dump---")
              var ds = tx.objectStore("note");
              ds.openCursor().onsuccess = function (event) {
                  var cursor = event.target.result;
                  if (cursor) {
                      console.log(cursor.key);
                      console.dir(cursor.value);
                      cursor.continue();
                  }
                  else {
                      console.log("---End cursor dump---");
                  }
              };
          }
  
  
          document.querySelector("#test").addEventListener("click", function (clickevent) {
              try {
                  var transaction = db.transaction("note", "readwrite");
                  transaction.oncomplete = function (event) {
                      console.log("Cursor dump in 'add' read/write transaction oncomplete");
                      displayNotes();
                      console.log("add transaction oncomplete done!");
                  };
                  transaction.onerror = function (event) {
                      console.log("add transaction onerror");
                  };
                  transaction.onabort = function (event) {
                      console.log("add transaction onabort");
                  };
  
                  var objectStore = transaction.objectStore("note");
  
                  var request = objectStore.add({
                      title: "note header",
                      body: "this is random note body content " + Math.floor(Math.random() * 1000)
                  });
  
                  request.onsuccess = function (event) {
                      console.log("add request onsuccess");
                  };
                  request.onerror = function (event) {
                      console.log("add request onerror");
                      console.dir(event);
                  };
              }
              catch (e) {
                  console.log('catchall exception');
                  console.log(e);
                  alert("bad things done");
              }
  
          });
      }
  &lt;/script&gt;
  &lt;/head&gt;
  
  &lt;body onload="init()"&gt; 
      &lt;h1&gt;IndexedDB simplest example&lt;/h1&gt;
      &lt;p&gt;
          &lt;button id="test"&gt;Push To Add Row To IndexedDB&lt;/button&gt;
      &lt;/p&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>