This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 10088 - The spec does not define what happens if an object store is modified while a cursor is iterating it.
Summary: The spec does not define what happens if an object store is modified while a ...
Status: RESOLVED FIXED
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: Indexed Database API (show other bugs)
Version: unspecified
Hardware: PC Windows NT
: P2 normal
Target Milestone: ---
Assignee: Jonas Sicking (Not reading bugmail)
QA Contact: public-webapps-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-05 18:08 UTC by Andrei Popescu
Modified: 2010-11-08 11:34 UTC (History)
3 users (show)

See Also:


Attachments

Description Andrei Popescu 2010-07-05 18:08:01 UTC
It is possible to modify an object store while a cursor is iterating over its objects in the same transaction. Right now, the behavior of the cursor is unspecified.

We discussed the 3 solutions for handling this situation:

1. Making the cursor iterate over a snapshot of the data, that is, modifications done during the iteration are not visible when the cursor callbacks fire. The snapshot would be taken when the cursor is created.
2. As 1, except that the snapshot is taken when the transaction starts.
3. Cursors iterate over "live" data and modifications to the object store are visible during the iteration.

The consensus for now is to go with solution 3. For pros and cons of each approach as well as motivation for picking the current solution, please see:

http://lists.w3.org/Archives/Public/public-webapps/2010JulSep/0056.html
Comment 1 Jonas Sicking (Not reading bugmail) 2010-11-01 04:50:50 UTC
Working at rewriting cursor handling, especially related to indexes.
Comment 2 Jonas Sicking (Not reading bugmail) 2010-11-08 11:34:59 UTC
Should be fixed by http://dvcs.w3.org/hg/IndexedDB/rev/8716288a4fe1

Would be great if someone could check that it looks correct.