Re: [IndexedDB] setVersion blocked on uncollected garbage IDBDatabases

On Mon, Feb 7, 2011 at 8:09 PM, Jeremy Orlow <> 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