Re: [w3c/IndexedDB] Add support for async update or another way to prepopulate the databade (#126)

> One interpretation might be that when you get the upgradeneeded event you must perform the upgrade within that transaction; you can't fetch the initial data with an async request to the server since you hit the usual transaction autocommit problem.

Ah - I wasn't even considering a remote server, based on the original question.

That said, if that was the intent...

> A pattern that works in that case is to abort the upgrade (via request.transaction.abort()), fetch the data, and retry the upgrade.

Indeed.


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/IndexedDB/issues/126#issuecomment-264746962

Received on Monday, 5 December 2016 01:07:04 UTC