मैं मानता होगा कि मैं बहुत IndexedDBUncaught InvalidStateError: एक संस्करण परिवर्तन लेन-देन चल रहा है
करने के लिए नए मैं indexedDB
का एक सरल कोड लिखा हूँ और यह पीछा किया जाता है के रूप में: 'IDBDatabase' चालू 'लेन-देन' निष्पादित करने में विफल:
function go(){var req = window.indexedDB.open("Uploader", 1), db;
req.onerror=function(e){console.log('Error')};
req.onsuccess = function(e){db=e.target.result;};
req.onupgradeneeded = function(e){console.log(db);
db=e.target.result;db=e.target.result;
var os = db.createObjectStore('Files', {keyPath:"files"});
os.createIndex('text', 'text_file', {unique:false})
var trans = db.transaction(['text'], "readwrite");
var objectstore= trans.objectStore("text");
var addreq = objectstore.add('Instructions.js');
addreq.onsuccess = function(e){console.log('Success!');console.dir(e)}
}}
त्रुटि यह मुझे दे रहा है है Uncaught InvalidStateError: Failed to execute 'transaction' on 'IDBDatabase': A version change transaction is running.
यह कह रही है कि A version change Transaction is running
लेकिन जहां तक मैं अध्ययन किया है, एक संस्करण परिवर्तन लेन-देन IDBFactory.open
विधि से बनाया गया है और मैं का इस्तेमाल किया है नहीं और मैं उल्लेख किया है कि इस लेन-देन readwrite
है और इस सौदे onupgradeneeded
में है तो क्यों कोई त्रुटि है?
मैं मानता होगा कि मैं बहुत IndexedDB
लेकिन मैं कैसे लेन-देन की अवधि निर्दिष्ट करूँ ? –
और यह मेरे एक त्रुटि 'Uncaught NotFoundError दे रहा है: 'IDBTransaction' चालू 'ObjectStore' निष्पादित करने में विफल: निर्दिष्ट वस्तु दुकान लाइन पर found.' नहीं किया गया था' transaction.objectStore ('पाठ') ' –