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 10064 - Modifying functions should throw when called under invalid conditions
Summary: Modifying functions should throw when called under invalid conditions
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: Andrei Popescu
QA Contact: public-webapps-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-02 09:40 UTC by Jonas Sicking (Not reading bugmail)
Modified: 2010-07-02 20:01 UTC (History)
2 users (show)

See Also:


Attachments

Description Jonas Sicking (Not reading bugmail) 2010-07-02 09:40:54 UTC
There are a number of situations where we immediately upon call to modifying functions know that the call was made in error without consulting the database. This applies in the following situations:

1. When IDBObjectStore.add, IDBObjectStore.put, IDBObjectStore.remove, IDBCursor.update or IDBCursor.remove is called from a READ_ONLY transaction.
2. When the object provided to add/put/update can't be cloned using the structured clone algorithm. (we can rely on HTML5 to define when and what this throws)
3. When IDBCursor.update is called in such a way that it alters the key of the object. (only apples to in-line keys)
4. When IDBObjectStore.add or IDBObjectStore.put is called on an objectStore which doesn't use a key generator, and no key is provided (note that keys are supplied in-line in some stores)


For more details about rationale, see the thread started at
http://lists.w3.org/Archives/Public/public-webapps/2010JulSep/0002.html