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

RE: IndexedDB: calling IDBTransaction.objectStore() or IDBObjectStore.index() after transaction is finished?

From: Israel Hilerio <israelh@microsoft.com>
Date: Sat, 17 Dec 2011 00:28:06 +0000
To: Joshua Bell <jsbell@chromium.org>, Jonas Sicking <jonas@sicking.cc>
CC: Adam Herchenroether <aherchen@microsoft.com>, Victor Ngo <vicngo@microsoft.com>, "public-webapps@w3.org" <public-webapps@w3.org>
Message-ID: <F695AF7AA77CC745A271AD0F61BBC61E41E1E05F@TK5EX14MBXC115.redmond.corp.microsoft.com>
Sounds good!  I've updated the bug to reflect this decision.

Israel
On Friday, December 16, 2011 3:37 PM, Joshua Bell wrote:
On Fri, Dec 16, 2011 at 3:30 PM, Jonas Sicking <jonas@sicking.cc<mailto:jonas@sicking.cc>> wrote:
On Fri, Dec 16, 2011 at 2:41 PM, Israel Hilerio <israelh@microsoft.com<mailto:israelh@microsoft.com>> wrote:
> On December 15, 2011 10:20 PM, Jonas Sicking wrote:
>> On Thu, Dec 15, 2011 at 12:54 PM, Joshua Bell <jsbell@chromium.org<mailto:jsbell@chromium.org>>
>> wrote:
>> > Is there any particular reason why IDBTransaction.objectStore() and
>> > IDBObjectStore.index() should be usable (i.e. return values vs. raise
>> > exceptions) after the containing transaction has finished?
>> >
>> > Changing the spec so that calling these methods after the containing
>> > transaction has finished raises InvalidStateError (or
>> > TransactionInactiveError) could simplify implementations.
>>
>> That would be ok with me.
>>
>> Please file a bug though.
>>
>> / Jonas
>>
> Do we want to throw two Exceptions or one?
> We currently throw a  NOT_ALLOWED_ERR for IDBTransaction.objectStore() and a TRANSACTION_INACTIVE_ERR for IDBObjectStore.index().
>
> It seems that we could throw a TRANSACTION_INACTIVE_ERR for both.
> What do you think?
I think InvalidStateError is slightly more correct (for both
IDBTransaction.objectStore() and IDBObjectStore.index) since we're not
planning on throwing if those functions are called in between
transaction-request callbacks, right?

I.e. TransactionInactiveError is more appropriate if it's always
thrown whenever a transaction is inactive, which isn't the case here.

/ Jonas

Agreed - that we should be consistent between methods, and that InvalidStateError is slightly more correct for the reason Jonas cites.

For reference, Chrome currently throws NOT_ALLOWED_ERR for IDBTransaction.objectStore() but does not throw for IDBObjectStore.index().
Received on Saturday, 17 December 2011 00:28:46 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:49 GMT