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 ...
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
Depends on:
Reported: 2010-07-05 18:08 UTC by Andrei Popescu
Modified: 2010-11-08 11:34 UTC (History)
3 users (show)

See Also:


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:
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

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