Skip to content

Transaction

David Fahlander edited this page Jul 31, 2014 · 38 revisions

Represents a database transaction.

Construction

Transactions are created in the following methods and events:

The currently executing transaction is retrieved from Dexie.currentTransaction property.

Properties

active : Boolean

True until transaction is committed or aborted.

db : Dexie

The Dexie instance that created the transaction.

mode : String

"readonly" or "readwrite"

idbtrans : IDBTransaction

Backend transaction instance

tables : Object

Map between table names and Table instances

storeNames : Array

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

Abort the transaction.

Get a Table or WriteableTable instance representing one of your object stores specified in Version.stores(). 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

Create Transaction

Initialize Database where a transaction in an Upgrade state is given to subscriber.

Upgrade Database where a transaction in an Upgrade state is given to subscriber.

Clone this wiki locally