Dart API Referencedart:htmlIDBTransaction

IDBTransaction Interface

The IDBTransaction interface of the IndexedDB API provides a static, asynchronous transaction on a database using event handler attributes. All reading and writing of data are done within transactions. You actually use IDBDatabase to start transactions and use IDBTransaction to set the mode of the transaction and access an object store and make your request. You can also use it to abort transactions.

Inherits from: EventTarget

Extends

EventTarget

Static Fields

Code final int READ_ONLY #

static final int READ_ONLY = 0;

Code final int READ_WRITE #

static final int READ_WRITE = 1;

Code final int VERSION_CHANGE #

static final int VERSION_CHANGE = 2;

Methods

Code void abort() #

Returns immediately, and undoes all the changes to objects in the database associated with this transaction. If this transaction has been aborted or completed, then this method throws an error event, with its code set to ABORT_ERR and a suitable message.

All pending IDBRequest objects created during this transaction have their errorCode set to ABORT_ERR.

Exceptions

This method can raise an IDBDatabaseException, with the following code:

NOT_ALLOWED_ERR
The transaction has already been committed or aborted.
void abort();

Code IDBObjectStore objectStore(String name) #

Returns an object store that has already been added to the scope of this transaction. Every call to this method on the same transaction object, with the same name, returns the same IDBObjectStore instance. If this method is called on a different transaction object, a different IDBObjectStore instance is returned.

Parameters
name
The name of the requested object store.
Returns
IDBObjectStore
An object for accessing the requested object store.
Exceptions

The method can raise an IDBDatabaseException with the following code:

NOT_FOUND_ERR
The requested object store is not in this transaction's scope.
NOT_ALLOWED_ERR
request is made on a source object that has been deleted or removed..
IDBObjectStore objectStore(String name);

Code IDBTransactionEvents get on() #

IDBTransactionEvents get on();

Code void $dom_addEventListener(String type, EventListener listener, [bool useCapture]) #

void $dom_addEventListener(String type, EventListener listener, [bool useCapture]);

Code bool $dom_dispatchEvent(Event evt) #

bool $dom_dispatchEvent(Event evt);

Code void $dom_removeEventListener(String type, EventListener listener, [bool useCapture]) #

void $dom_removeEventListener(String type, EventListener listener, [bool useCapture]);

Fields

Code final IDBDatabase db #

The database connection that this transaction is associated with.
final IDBDatabase db;

Code final DOMError error #

final DOMError error;

Code final String mode #

The mode for isolating access to data in the object stores that are in the scope of the transaction. For possible values, see Constants. The default value is READ_ONLY.
final String mode;

This page includes content from the Mozilla Foundation that is graciously licensed under a Creative Commons: Attribution-Sharealike license. Mozilla has no other association with Dart or dartlang.org. We encourage you to improve the web by contributing to The Mozilla Developer Network.