abort() {
    if (!this[PRIVATE.active]) {
      throw new Error("The transaction is no longer active")
    }

    this[PRIVATE.active] = false

    if (!this[PRIVATE.transactionRunner]) {
      return this[PRIVATE.transactionRunnerPromise].then(() => {
        this[PRIVATE.active] = true
        return this.abort()
      })
    }

    if (!this[PRIVATE.transactionRunner].isActive) {
      throw new Error("The transaction is no longer active")
    }

    return this[PRIVATE.transactionRunner].abort().then(() => {
      throw new Error("Unexpected transaction end. Has the transaction " +
          "been already committed?")
    }).catch((error) => {
      if (error.name !== "AbortError") {
        throw error
      }

      // we expect this error, it is a transaction abort error... at least
      // let's hope it is

      // let's revert any entity modifications
      for (let entities of this[PRIVATE.entities].values()) {
        for (let dataAndEntity of entities.values()) {
          let entity = dataAndEntity.entity
          Object.assign(entity, clone(dataAndEntity.data))
          this[PRIVATE.deleteExtraneousFields](entity, dataAndEntity.data)
        }
      }

      this[PRIVATE.completionCallback]()

      throw error
    })
  }
/**
   * Aborts this transaction and reverts all changes done to the entities
   * managed by the entity managed owning this transaction, including the
   * changes done before this transaction has been started.
   *
   * @return {Promise<undefined>} A promise that will be REJECTED once the
   *         transaction has been aborted. The promise will never be resolved.
   */
Aborts this transaction and reverts all changes done to the entities
managed by the entity managed owning this transaction, including the
changes done before this transaction has been started.

@return {Promise} A promise that will be REJECTED once the
transaction has been aborted. The promise will never be resolved.
Aborts this transaction and reverts all changes done to the entities managed by the entity managed owning this transaction including the changes done before this transaction has been started . @return { Promise } A promise that will be REJECTED once the transaction has been aborted . The promise will never be resolved .
abort() {
    if (!this[PRIVATE.active]) {
      throw new Error("The transaction is no longer active")
    }
    this[PRIVATE.active] = false
    if (!this[PRIVATE.transactionRunner]) {
      return this[PRIVATE.transactionRunnerPromise].then(() => {
        this[PRIVATE.active] = true
        return this.abort()
      })
    }
    if (!this[PRIVATE.transactionRunner].isActive) {
      throw new Error("The transaction is no longer active")
    }
    return this[PRIVATE.transactionRunner].abort().then(() => {
      throw new Error("Unexpected transaction end. Has the transaction " +
          "been already committed?")
    }).catch((error) => {
      if (error.name !== "AbortError") {
        throw error
      }
      for (let entities of this[PRIVATE.entities].values()) {
        for (let dataAndEntity of entities.values()) {
          let entity = dataAndEntity.entity
          Object.assign(entity, clone(dataAndEntity.data))
          this[PRIVATE.deleteExtraneousFields](entity, dataAndEntity.data)
        }
      }
      this[PRIVATE.completionCallback]()
      throw error
    })
  }
abort ( ) { if ( ! this [ PRIVATE . active ] ) { throw new Error ( "The transaction is no longer active" ) } this [ PRIVATE . active ] = false if ( ! this [ PRIVATE . transactionRunner ] ) { return this [ PRIVATE . transactionRunnerPromise ] . then ( ( ) => { this [ PRIVATE . active ] = true return this . abort ( ) } ) } if ( ! this [ PRIVATE . transactionRunner ] . isActive ) { throw new Error ( "The transaction is no longer active" ) } return this [ PRIVATE . transactionRunner ] . abort ( ) . then ( ( ) => { throw new Error ( "Unexpected transaction end. Has the transaction " + "been already committed?" ) } ) . catch ( ( error ) => { if ( error . name !== "AbortError" ) { throw error } for ( let entities of this [ PRIVATE . entities ] . values ( ) ) { for ( let dataAndEntity of entities . values ( ) ) { let entity = dataAndEntity . entity Object . assign ( entity , clone ( dataAndEntity . data ) ) this [ PRIVATE . deleteExtraneousFields ] ( entity , dataAndEntity . data ) } } this [ PRIVATE . completionCallback ] ( ) throw error } ) }
Aborts this transaction and reverts all changes done to the entities
 managed by the entity managed owning this transaction, including the
 changes done before this transaction has been started.
Aborts this transaction and reverts all changes done to the entities managed by the entity managed owning this transaction including the changes done before this transaction has been started .
// we expect this error, it is a transaction abort error... at least // let's hope it is // let's revert any entity modifications