[w3c/IndexedDB] Proposal: Add "writeonly" transaction mode (#234)

Forked off from #34 and previous mentioned on the [old wiki]( https://www.w3.org/2008/webapps/wiki/IndexedDatabaseFeatures), but formalizing it a bit:

* Introduce a new [transaction mode](https://w3c.github.io/IndexedDB/#transaction-mode), "writeonly"
* If a transaction's mode is "writeonly":
  * any IDBObjectStore or IDBIndex operation other than `put()` or `add()` will throw `NotSupportedError` 
  * `put()` and `add()` return null (return type changed to `IDBRequest?`)
  * `success`/`error` events not fired (i.e. don't bubble up to the transaction/connection)
  * a failed operation (usually, conflicting `add()`) still causes the transaction to abort
  * `complete`/`abort` events are still fired against the transaction

There is probably additional spec text required for clarity, but effectively since the transaction can no longer become active after the [cleanup transactions](https://w3c.github.io/IndexedDB/#cleanup-indexed-database-transactions) steps run when the task ends, the transaction can attempt to commit immediately; it needs to wait until all of the `put()`s/`add()`s finish. The [transaction lifetime](https://w3c.github.io/IndexedDB/#transaction-lifetime-concept) steps are still a bit wishy-washy; I didn't completely revise those as part of the big 2.0 rework of the spec.




-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/IndexedDB/issues/234

Received on Tuesday, 10 April 2018 19:47:26 UTC