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

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 UTC