私たちは、Firefox で IndexedDB を多用してオフライン データを保存するアプリケーションを構築しています。
これはほとんどの場合うまく機能しますが、次のようなエラーで失敗することがあります。
Exception... "The operation failed because the requested database object could
not be found. For example, an object store did not exist but was being opened."
code: "3" nsresult: "0x80660003 (NS_ERROR_DOM_INDEXEDDB_NOT_FOUND_ERR)"
コードのさまざまな場所で失敗しているようです。これが原因の1つです:
_writePage: (storeName, startIndex, endIndex, binder) ->
writeTransaction = @connection.transaction([storeName], @idbTransaction.READ_WRITE)
store = writeTransaction.objectStore(storeName)
for index in [startIndex...endIndex] when (item = binder.list[index])?
writeRequest = store.put(item)
writeRequest.onerror = binder.failCallback()
writeRequest.onsuccess = binder.successCallback()
if endIndex >= binder.list.length
binder.finishedRegisteringCallbacks()
return
setTimeout((=> @_writePage(storeName, endIndex, endIndex + @WRITE_EACH_PAGE_SIZE, binder)), @WRITE_EACH_PAGE_DELAY)
null
私を困惑させているのは、通常は機能する自動テスト中に、失敗がまれに発生することです (数百回の実行ごとにこれらの失敗の 1 つが見られます)。
数百メガバイトのオーダーで、大量のデータも保存していることに言及する価値があります。自動化されたテストでは数メガバイトしか保存されないことが判明したため、サイズの問題ではありません。
他の誰かがこの問題を経験しましたか (または、さらに良いことに、経験して修正しました!)?