startTransaction() {
    if (this[PRIVATE.activeTransaction]) {
      throw new Error("This entity manager is already running a transaction")
    }

    this[PRIVATE.rwTransactionRunner] = this[PRIVATE.connection].then((db) => {
      let transaction = db.startTransaction(db.objectStoreNames)
      return new TransactionRunner(
        transaction,
        db.objectStoreNames[0],
        this[PRIVATE.activeTransaction],
        this[PRIVATE.options].idleTransactions
      )
    })

    this[PRIVATE.activeTransaction] = new Transaction(
      this,
      this[PRIVATE.rwTransactionRunner],
      this[PRIVATE.entities],
      (entityClass, keyPath, entityData) => {
        return this[PRIVATE.manage](entityClass, keyPath, entityData)
      },
      () => {
        this[PRIVATE.rwTransactionRunner] = null
        this[PRIVATE.activeTransaction] = null
        this.clear()
      }
    )

    return this[PRIVATE.activeTransaction]
  }
/**
   * Starts a new transaction if there is not already one active. All entities
   * that will become managed by this entity manager during the transaction
   * will have their changes automatically persisted when the transaction is
   * committed.
   *
   * Note that multiple simultaneous transactions cannot be started from the
   * same entity manager. The transaction will lock all object stores in the
   * database until the transaction completes.
   *
   * The persistence context of this entity manager will be cleared after the
   * transaction completes (all entities will become detached).
   *
   * @return {Transaction} The started transaction.
   * @throws {Error} Thrown if there already is a transaction in progress on
   *         this entity manager.
   */
Starts a new transaction if there is not already one active. All entities
that will become managed by this entity manager during the transaction
will have their changes automatically persisted when the transaction is
committed.

Note that multiple simultaneous transactions cannot be started from the
same entity manager. The transaction will lock all object stores in the
database until the transaction completes.

The persistence context of this entity manager will be cleared after the
transaction completes (all entities will become detached).

@return {Transaction} The started transaction.
@throws {Error} Thrown if there already is a transaction in progress on
this entity manager.
Starts a new transaction if there is not already one active . All entities that will become managed by this entity manager during the transaction will have their changes automatically persisted when the transaction is committed . Note that multiple simultaneous transactions cannot be started from the same entity manager . The transaction will lock all object stores in the database until the transaction completes . The persistence context of this entity manager will be cleared after the transaction completes ( all entities will become detached ) . @return { Transaction } The started transaction . @throws { Error } Thrown if there already is a transaction in progress on this entity manager .
startTransaction() {
    if (this[PRIVATE.activeTransaction]) {
      throw new Error("This entity manager is already running a transaction")
    }
    this[PRIVATE.rwTransactionRunner] = this[PRIVATE.connection].then((db) => {
      let transaction = db.startTransaction(db.objectStoreNames)
      return new TransactionRunner(
        transaction,
        db.objectStoreNames[0],
        this[PRIVATE.activeTransaction],
        this[PRIVATE.options].idleTransactions
      )
    })
    this[PRIVATE.activeTransaction] = new Transaction(
      this,
      this[PRIVATE.rwTransactionRunner],
      this[PRIVATE.entities],
      (entityClass, keyPath, entityData) => {
        return this[PRIVATE.manage](entityClass, keyPath, entityData)
      },
      () => {
        this[PRIVATE.rwTransactionRunner] = null
        this[PRIVATE.activeTransaction] = null
        this.clear()
      }
    )
    return this[PRIVATE.activeTransaction]
  }
startTransaction ( ) { if ( this [ PRIVATE . activeTransaction ] ) { throw new Error ( "This entity manager is already running a transaction" ) } this [ PRIVATE . rwTransactionRunner ] = this [ PRIVATE . connection ] . then ( ( db ) => { let transaction = db . startTransaction ( db . objectStoreNames ) return new TransactionRunner ( transaction , db . objectStoreNames [ 0 ] , this [ PRIVATE . activeTransaction ] , this [ PRIVATE . options ] . idleTransactions ) } ) this [ PRIVATE . activeTransaction ] = new Transaction ( this , this [ PRIVATE . rwTransactionRunner ] , this [ PRIVATE . entities ] , ( entityClass , keyPath , entityData ) => { return this [ PRIVATE . manage ] ( entityClass , keyPath , entityData ) } , ( ) => { this [ PRIVATE . rwTransactionRunner ] = null this [ PRIVATE . activeTransaction ] = null this . clear ( ) } ) return this [ PRIVATE . activeTransaction ] }
Starts a new transaction if there is not already one active.
Starts a new transaction if there is not already one active .