Skip to content

Transaction

David Fahlander edited this page Apr 15, 2014 · 38 revisions

Represents a database transaction (IDBTransaction)

Construction

A Transaction instance is sent as a callback parameter in the following methods:

Properties

active : Boolean

True if transaction has not been committed or aborted yet. Otherwise false.

mode : String

"readonly" or "readwrite"

storeNames : Array

Array of object store names that the Transaction can access. The list depends on which tables where given to Dexie.transaction() when starting the transaction. For upgrade transactions, all object stores will be present in this list.

idbtrans : IDBTransaction

Backend IDB transaction object.

Abort the transaction.

Get a Table or WriteableTable instance representing one of your object stores specified in Dexie.version. Table is returned if the transaction was opened in "r" (readonly) mode. WriteableTable will be returned if the transaction was opened in "rw" (readwrite) mode. If transaction is a versionchange transaction (happens only in your registered upgraders and callbacks to on("populate"), the returned instance will be WriteableTable.

See Also

Clone this wiki locally