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

Re: [indexeddb] Cursor data Question

From: Jonas Sicking <jonas@sicking.cc>
Date: Mon, 25 Apr 2011 18:41:01 -0700
Message-ID: <BANLkTi=iD0fwqqqBjSG1So+YOdRSrNW4qw@mail.gmail.com>
To: Israel Hilerio <israelh@microsoft.com>
Cc: "public-webapps@w3.org" <public-webapps@w3.org>
On Mon, Apr 25, 2011 at 6:23 PM, Israel Hilerio <israelh@microsoft.com> wrote:
> In reading the spec, there doesn’t seem to be any long-term state associated
> with a cursor.  However, there is an edge case I would like to validate with
> everyone.
>
> If I have cursor pointing to a specific data record and then I delete the
> record before accessing it, what happens to the value and key of the cursor
> object?  Do we expect the cursor instance to still have the values of the
> currently accessed record?

Yes, .value and .key are synchronous, so we don't want them to have to
access data in the database. Instead they copy the data once fetched
from the database.

We discussed this specifically on the list iirc. This also has the
effect that calling cursor.update() can create a new entry, if the old
entry was removed before the call.

By the way, for all of these questions, feel free to add explicit text
to the specification. Preferably in the form of a note. The spec
template supports this by adding:

<p class=note>
  ....
</p>

/ Jonas
Received on Tuesday, 26 April 2011 01:41:57 GMT

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