Skip to content

Proposal: Add explicit IDBTransaction.commit() (was: add "writeonly" mode) #234

Closed
@inexorabletash

Description

@inexorabletash

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions