This page is In Progress

Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.

transaction

Summary

Execute the steps for creating a transaction in a sychronous fashion.

Method of apis/indexeddb/IDBDatabaseapis/indexeddb/IDBDatabase

Syntax

var object = object.transaction(storeNames, mode);

Parameters

storeNames

Data-type
Blob

If specified, defines the names of the object stores included in the transaction. Use a DOMString to specify a single object store or an array of DOMString values to specify multiple object stores.

mode

Data-type
Blob

Value Meaning

readonly

Changes are not allowed in this transaction.

readwrite

Changes are allowed in this transaction.

versionchange

Objects in the database can be create

Return Value

Returns an object of type DOM NodeDOM Node

Notes

Remarks

This method can throw the following DOMException exceptions:

Exception properties Description

name: InvalidAccessError
code: DOMException.INVALID_ACCESS_ERR (15)
The value of the storeNames parameter is blank or otherwise invalid.

name: InvalidStateError
code: DOMException.INVALID_STATE_ERR (11)
The database has been closed or a transaction has been requested for an object that has been deleted or is otherwise unavailable.

name: NotFoundError
code: DOMException.NOT_FOUND_ERR (8)
A specified object store could not be found in the current database (case-sensitive).

name: TypeError
The value of the mode parameter is not supported.

Note As of Internet Explorer 10, the code property is deprecated in favor of the name property, which is preferred for standards compliance and future compatibility.

Syntax

Standards information

Attributions