Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
   * Copyright 2012 Google Inc.
   * Licensed under the Apache License, Version 2.0 (the "License"); you may not
   * use this file except in compliance with the License. You may obtain a copy of
   * the License at
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  * License for the specific language governing permissions and limitations under
  * the License.
 package elemental.html;
 import  elemental.html.*;
 import java.util.Date;

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

 public interface IDBTransaction extends EventTarget {

Allows data to be read but not changed. 
     static final int READ_ONLY = 0;

Allows reading and writing of data in existing data stores to be changed.
     static final int READ_WRITE = 1;

Allows any operation to be performed, including ones that delete and create object stores and indexes. This mode is for updating the version number of transactions that were started using the setVersion() method of IDBDatabase objects. Transactions of this mode cannot run concurrently with other transactions.
     static final int VERSION_CHANGE = 2;

The database connection that this transaction is associated with.
   DOMError getError();

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.
   String getMode();
   void setOnabort(EventListener arg);
   void setOncomplete(EventListener arg);
   void setOnerror(EventListener arg);


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.


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

The transaction has already been committed or aborted.
   void abort();
   EventRemover addEventListener(String typeEventListener listenerboolean useCapture);
   boolean dispatchEvent(Event evt);


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.

The name of the requested object store.
An object for accessing the requested object store.

The method can raise an IDBDatabaseException with the following code:

The requested object store is not in this transaction's scope.
request is made on a source object that has been deleted or removed..
  void removeEventListener(String typeEventListener listener);
  void removeEventListener(String typeEventListener listenerboolean useCapture);
New to GrepCode? Check out our FAQ X