W3C home > Mailing lists > Public > public-webapps@w3.org > July to September 2009

Re: [web databases] changeVersion error reporting

From: Michael Nordman <michaeln@google.com>
Date: Thu, 3 Sep 2009 18:06:37 -0700
Message-ID: <fa2eab050909031806k208db845u3094d9e727028bbb@mail.gmail.com>
To: Joćo Eiras <joaoe@opera.com>
Cc: "public-webapps@w3.org" <public-webapps@w3.org>
If the version is stored in the database file itself, as is with webkit's
impl for example, the database object does not have immediate access to that
On Thu, Sep 3, 2009 at 5:57 PM, Joćo Eiras <joaoe@opera.com> wrote:

> Hi!
> Database.changeVersion expects oldVersion and newVersion arguments. The
> Database also specifies a version attribute.
> The transaction steps tell to fail the transaction due to the failed
> preflight condition if oldVersion does not match the current database
> version.
> Meanwhile, the callbacks have been made optional, and rightly so.
> So:
>  - if the author does not use the callbacks, there no error reporting that
> the preflight condition failed
>  - the version check can be done synchronously when changeVersion is called
> because the Database object has immediate access to that value, and it's
> much more convenient for the author to just get an exception (like
> INVALID_STATE_ERR) than to have to go through the entire callback process
> just to realize later that the transaction failed due to the mismatched
> version. It also spares the user agent from creating and executing a
> transaction that WILL fail.
> To solve these issues, I would suggest doing immediate synchronous
> validation of the version when changeVersion is called, throwing an
> exception on error, and drop that step from the preflight operations.
> Thank you.
Received on Friday, 4 September 2009 01:07:33 UTC

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