W3C home > Mailing lists > Public > public-webapps@w3.org > April to June 2011

Re: [IndexedDB] deleteObjectStore method and updates to IDBDatabase.objectStoreNames on the client

From: Jeremy Orlow <jorlow@chromium.org>
Date: Wed, 4 May 2011 09:47:12 +0530
Message-ID: <BANLkTimdWpoQUkWtCU=o=yhu+S3p+rd8+Q@mail.gmail.com>
To: Israel Hilerio <israelh@microsoft.com>
Cc: "public-webapps@w3.org" <public-webapps@w3.org>
Well, createObjectStore is synchronous, so that one's easy.  Everything
happens at once in terms of side effects.

As for delete: why is this asynchronous again?  It seems easiest just to
make it sync unless there's some major problem with doing so.

Either way, it seems that the change to objectStoreNames should either
happen immediately or when firing the onsuccess event (i.e. not just at some
random time in between).

J

On Wed, May 4, 2011 at 7:13 AM, Israel Hilerio <israelh@microsoft.com>wrote:

> In looking at createObjectStore on IDBDatabase, it seems that we would have
> to update the IDBDatabase.objectStoreNames attribute on the client side
> after returning the IDBObjectStore.  Otherwise, it would be difficult to
> detect that an objectStore with the same name already exists and throw a
> CONSTRAINT_ERR exception.
>
> Following this pattern, would it make sense to update the
> IDBDatabase.objectStoreNames attribute on the client side after executing
> deleteObjectStore before the async operation is executed.  This would allow
> us to support scenarios like:
>
> var b = db.createObjectStore(B);
> var req = db.deleteObjectStore(B);
> b = db.createObjectStore(B);
>
> What do you think?
>
> Israel
>
>
Received on Wednesday, 4 May 2011 04:17:59 GMT

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