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 9882 - Behavior when attempting to write data to an objectStore opened as read only unspecified
Summary: Behavior when attempting to write data to an objectStore opened as read only ...
Status: RESOLVED FIXED
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: Indexed Database API (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: Nikunj Mehta
QA Contact: public-webapps-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-08 17:22 UTC by Jeremy Orlow
Modified: 2010-11-08 18:15 UTC (History)
5 users (show)

See Also:


Attachments

Description Jeremy Orlow 2010-06-08 17:22:42 UTC
When you open an objectStore with a read only mode, any subsequent write operation should probably result in an error.  I don't see anywhere in the spec that specifically says this or mentions what error code should be used.  Currently in the spec, writing with the noOverwrite flag set causes a CONSTRAINT_ERR, so I'm guessing that's the best one to go with for this condition as well?
Comment 1 Jonas Sicking (Not reading bugmail) 2010-11-08 18:14:18 UTC
I introduced a specific READ_ONLY_ERR to cover this. It seems worth having a separate error rather than throwing NOT_ALLOWED_ERR since it's a very easy mistake to make to forget to specify the optional 'mode' parameter when creating a transaction, and so I think it's worth making this error easy to diagnose.

http://dvcs.w3.org/hg/IndexedDB/rev/0901d0b89904
Comment 2 Jonas Sicking (Not reading bugmail) 2010-11-08 18:15:18 UTC
I introduced a specific READ_ONLY_ERR to cover this. It seems worth having a
separate error rather than throwing NOT_ALLOWED_ERR since it's a very easy
mistake to make to forget to specify the optional 'mode' parameter when
creating a transaction, and so I think it's worth making this error easy to
diagnose.

http://dvcs.w3.org/hg/IndexedDB/rev/0901d0b89904