W3C home > Mailing lists > Public > public-webapps@w3.org > January to March 2012

Re: [IndexedDB] IDBDAtabase.transaction clarification

From: Jonas Sicking <jonas@sicking.cc>
Date: Thu, 23 Feb 2012 22:15:04 +0100
Message-ID: <CA+c2ei9K_yPxhO0pKgrtkTSbLEewW-NsHxp-Xwg6zJS6SdxTwg@mail.gmail.com>
To: Joćo Eiras <joaoe@opera.com>
Cc: "public-webapps@w3.org" <public-webapps@w3.org>
On Thu, Feb 23, 2012 at 9:27 PM, Joćo Eiras <joaoe@opera.com> wrote:
>
> Hi.
>
> It seems IDBDatabase.transaction in the working draft is poorly defined.
>
> IDBDatabase.transaction, according to the transaction creation algorithm,
> have a null callback, but then IDBDatabase.createObjectStore and
> IDBDatabase.deleteObjectStore say they should fail if not called from the
> transaction callback. I think it should be changed so they fail if there
> is not an active transaction, or that the current active transaction is
> not a VERSION_CHANGE one. Is this the intended behavior ?

Yes. Please file a bug.

> It tells IDBDatabase.transaction returns the IDBTransaction object.
> Shouldn't it be an IDBRequest object ? If not, then what the lifetime of
> the transaction ? When should it be commited ?

IDBTransaction is correct.

How committing works should be detailed in the Transaction part of the
Constructs section:

http://dvcs.w3.org/hg/IndexedDB/raw-file/tip/Overview.html#transaction-concept

> IDBDatabase.transaction accepts either an array of strings or string as
> first argument, which are the name of the object stores. What should
> be used for the very first transaction of an empty database with no
> object stores ? Empty array ?

When a database is created a VERSION_CHANGE transaction is
automatically created. So there is no need to call
IDBDatabase.transaction. Not entirely sure I understand the question
here.

/ Jonas
Received on Thursday, 23 February 2012 21:16:01 GMT

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