[whatwg] Moving openDatabase off the UI thread
Dimitri Glazkov
dimitri.glazkov at gmail.com
Thu Apr 10 04:48:10 PDT 2008
In the current SQL storage spec
(http://www.whatwg.org/specs/web-apps/current-work/multipage/section-sql.html),
all database operations can be nicely tucked onto a separate thread,
so that they don't block the UI thread, except for one place:
openDatabase has to query version information and open or create the
database.
This seems a bit out-of-sync (oh no, bad pun) with the rest of the
spec, where everything is asynchronous. Would it be more
logical/practical to explicitly (per spec) move the actual opening of
the database off the main thread? Like so:
Verifying database version and opening/creation of the database occurs
at pre-flight of the transaction, unless the database is already open.
Thus, no potential UI thread blockage by the database operations
during openDatabase invocation, as well as no need to raise the
INVALID_STATE_ERR exception.
What do you think?
:DG<
More information about the whatwg
mailing list