IDBTransaction class

The interface of the IndexedDB API provides a static, asynchronous transaction on a database using event handler attributes. All reading and writing of data is done within transactions. You use IDBDatabase to start transactions, to set the mode of the transaction (e.g. is it readonly or readwrite), and you access an IDBObjectStore to make a request. You can also use an object to abort transactions. Note: This feature is available in Web Workers

EventTarget

IDBTransaction

Transactions are started when the transaction is created, not when the first request is placed; for example consider this: var trans1 = db.transaction("foo", "readwrite"); var trans2 = db.transaction("foo", "readwrite"); var objectStore2 = trans2.objectStore("foo") var objectStore1 = trans1.objectStore("foo") objectStore2.put("2", "key"); objectStore1.put("1", "key"); After the code is executed the object store should contain the value "2", since trans2 should run after trans1.

Implemented types
Available extensions
Annotations
  • @JS()
  • @staticInterop

Constructors

IDBTransaction()
factory

Properties

db IDBDatabase

Available on IDBTransaction, provided by the PropsIDBTransaction extension

no setter
durability IDBTransactionDurability

Available on IDBTransaction, provided by the PropsIDBTransaction extension

no setter
error Exception?

Available on IDBTransaction, provided by the PropsIDBTransaction extension

no setter
hashCode int
The hash code for this object.
no setterinherited
mode IDBTransactionMode

Available on IDBTransaction, provided by the PropsIDBTransaction extension

no setter
objectStoreNames DOMStringList

Available on IDBTransaction, provided by the PropsIDBTransaction extension

no setter
onabort EventHandlerNonNull<Event>?

Available on IDBTransaction, provided by the PropsIDBTransaction extension

getter/setter pair
oncomplete EventHandlerNonNull<Event>?

Available on IDBTransaction, provided by the PropsIDBTransaction extension

getter/setter pair
onerror EventHandlerNonNull<Event>?

Available on IDBTransaction, provided by the PropsIDBTransaction extension

getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

abort() → void

Available on IDBTransaction, provided by the PropsIDBTransaction extension

addEventListener(String type, EventListener? callback, [dynamic options]) → void

Available on EventTarget, provided by the PropsEventTarget extension

commit() → void

Available on IDBTransaction, provided by the PropsIDBTransaction extension

dispatchEvent(Event event) bool

Available on EventTarget, provided by the PropsEventTarget extension

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
objectStore(String name) IDBObjectStore

Available on IDBTransaction, provided by the PropsIDBTransaction extension

removeEventListener(String type, EventListener? callback, [dynamic options]) → void

Available on EventTarget, provided by the PropsEventTarget extension

toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited