title: Uncaught InvalidStateError: Failed to execute 'transaction' on 'IDBDatabase': A version change transaction is running
body: <p>i must admit that i am very new to indexedDB</p>
  <p>I wrote a simple code of <code>indexedDB</code>  and it is as followed:</p>
  <pre><code>function go() {
     var req = window.indexedDB.open(&quot;Uploader&quot;, 1),
        db;
     req.onerror = function (e) {
        console.log(&quot;Error&quot;);
     };
     req.onsuccess = function (e) {
        db = e.target.result;
     };
     req.onupgradeneeded = function (e) {
        console.log(db);
        db = e.target.result;
        var os = db.createObjectStore(&quot;Files&quot;, { keyPath: &quot;files&quot; });
        os.createIndex(&quot;text&quot;, &quot;text_file&quot;, { unique: false });
        var trans = db.transaction([&quot;text&quot;], &quot;readwrite&quot;);
        var objectstore = trans.objectStore(&quot;text&quot;);
        var addreq = objectstore.add(&quot;Instructions.js&quot;);
        addreq.onsuccess = function (e) {
           console.log(&quot;Success!&quot;);
           console.dir(e);
        };
     };
  }
  </code></pre>
  <p>the error it is giving me is <code>Uncaught InvalidStateError: Failed to execute 'transaction' on 'IDBDatabase': A version change transaction is running.</code></p>
  <p>It is saying that <code>A version change Transaction is running</code> but as far as i have studied, a version change transaction is made from <code>IDBFactory.open</code> method and i haven't used and i have specified that this transaction is <code>readwrite</code> and this transaction is in <code>onupgradeneeded</code> then why there is an error?</p>
  <p>i must admit that i am very new to indexedDB</p>