W3C home > Mailing lists > Public > public-webapps@w3.org > January to March 2011

Re: [IndexedDB] setVersion blocked on uncollected garbage IDBDatabases

From: Jonas Sicking <jonas@sicking.cc>
Date: Tue, 8 Feb 2011 02:03:21 -0800
Message-ID: <AANLkTikpYW78e9exj11+Gh=_HyyYVUwoeDwsWzB7Oex7@mail.gmail.com>
To: Jeremy Orlow <jorlow@chromium.org>
Cc: public-webapps WG <public-webapps@w3.org>
On Mon, Feb 7, 2011 at 8:09 PM, Jeremy Orlow <jorlow@chromium.org> wrote:
> We're currently implementing the onblocked/setVersion semantics and ran into
> an interesting problem: if you don't call .close() on a database and simply
> expect it to be collected, then you ever being able to run a setVersion
> transaction is at the mercy of the garbage collecter doing a collection.
>  Otherwise implementations will assume the database is still open...right?
> If so, this seems bad.  But I can't think of any way to get around it.
>  Thoughts?

Hmm.. never thought about this problem. But yes, I suspect this issue
comes up in our implementation.

The only solution I can think of is to require (or recommend) that
implementations run the garbage collector in a context after firing
the "versionchange" event if the database still isn't closed. This
should be a rare occurrence simply because setVersion should be rare.

/ Jonas
Received on Tuesday, 8 February 2011 10:04:16 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 18:13:16 UTC