W3C home > Mailing lists > Public > public-webapps@w3.org > October to December 2011

RE: [IndexedDB] Passing an empty array to IDBDatabase.transaction

From: Israel Hilerio <israelh@microsoft.com>
Date: Fri, 7 Oct 2011 18:51:19 +0000
To: "Jonas Sicking (jonas@sicking.cc)" <jonas@sicking.cc>
CC: Webapps WG <public-webapps@w3.org>
Message-ID: <F695AF7AA77CC745A271AD0F61BBC61E3F4C4821@TK5EX14MBXC117.redmond.corp.microsoft.com>
On Thursday, October 06, 2011 5:44 PM, Jonas Sicking wrote:
> Hi All,
> In both the Firefox and the Chrome implementation you can pass an empty
> array to IDBDatabase.transaction in order to create a transaction which has
> a scope that covers all objectStores in the database. I.e. you can do
> something like:
> trans = db.transaction([]);
> trans.objectStore(<any objectstore here>);
> (Note that this is *not* a dynamic scoped transaction, it's still a static scope
> that covers the whole database).
> In other words, these implementations treat the following two lines as
> equivalent:
> trans = db.transaction([]);
> trans = db.transaction(db.objectStoreNames);
> This, however, is not specified behavior. According to the spec as it is now
> the transaction should be created with an empty scope.
> I suspect both Mozilla and Google implemented it this way because we had
> discussions about this syntax on the list. However apparently this syntax
> never made it into the spec. I don't recall why.
> I'm personally not a big fan of this syntax. My concern is that it makes it
> easier to create a widely scoped transaction which has less ability to run in
> parallel with other transactions, than to create a transaction with as narrow
> scope as possible. And passing db.objectStoreNames is always possible.
> What do people think we should do? Should we add this behavior to the
> spec? Or are implementations willing to remove it?
> / Jonas

Our implementation interprets the empty array as an empty scope.  We allow the transaction to be created but we throw a NOT_FOUND_ERR when trying to access any object stores.
I vote for not having this behavior :-).

Received on Friday, 7 October 2011 18:51:52 UTC

This archive was generated by hypermail 2.3.1 : Friday, 27 October 2017 07:26:36 UTC