Forked off from #34 and previous mentioned on the old wiki, but formalizing it a bit:
- Introduce a new 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 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 steps are still a bit wishy-washy; I didn't completely revise those as part of the big 2.0 rework of the spec.
Forked off from #34 and previous mentioned on the old wiki, but formalizing it a bit:
put()oradd()will throwNotSupportedErrorput()andadd()return null (return type changed toIDBRequest?)success/errorevents not fired (i.e. don't bubble up to the transaction/connection)add()) still causes the transaction to abortcomplete/abortevents are still fired against the transactionThere is probably additional spec text required for clarity, but effectively since the transaction can no longer become active after the cleanup 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 steps are still a bit wishy-washy; I didn't completely revise those as part of the big 2.0 rework of the spec.