runTransaction(operations) {
    let transaction = this.startTransaction()
    // We must wait for the connection promise to resolve in case the
    // operations would include merging entities into the persistence context
    // so that we have the key paths loaded.
    return this[PRIVATE.connection].then(() => {
      return operations(transaction)
    }).then((result) => {
      return transaction.commit().then(() => result)
    }).catch((error) => {
      return transaction.abort().catch((abortError) => {
        if (abortError && (abortError.name === "AbortError")) {
          return // transaction successfully aborted
        }

        console.error("Encountered an unexpected error while trying to " +
            "abort a transaction due to an error", abortError)
      }).then(() => {
        throw error
      })
    })
  }
/**
   * The methods starts a new transaction and executes the provided callback
   * within it. The method waits for the operations started by the callback to
   * finish, then commits the transaction and resolves to the value returned by
   * the promise returned by the provided operations callback.
   *
   * 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.
   *
   * @template R
   * @param {function(Transaction): Promise<R>} operations The callback that
   *        will execute the operations within the transaction. The callback
   *        must return a promise that resolves once all operations have been
   *        performed.
   * @return {Promise<R>} A promise that resolves to the value the promise
   *         returned by the provided operations callback resolved to.
   */
The methods starts a new transaction and executes the provided callback
within it. The method waits for the operations started by the callback to
finish, then commits the transaction and resolves to the value returned by
the promise returned by the provided operations callback.

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.

@template R
@param {function(Transaction): Promise} operations The callback that
will execute the operations within the transaction. The callback
must return a promise that resolves once all operations have been
performed.
@return {Promise} A promise that resolves to the value the promise
returned by the provided operations callback resolved to.
The methods starts a new transaction and executes the provided callback within it . The method waits for the operations started by the callback to finish then commits the transaction and resolves to the value returned by the promise returned by the provided operations callback . 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 . @template R @param { function ( Transaction ) : Promise } operations The callback that will execute the operations within the transaction . The callback must return a promise that resolves once all operations have been performed . @return { Promise } A promise that resolves to the value the promise returned by the provided operations callback resolved to .
runTransaction(operations) {
    let transaction = this.startTransaction()
    return this[PRIVATE.connection].then(() => {
      return operations(transaction)
    }).then((result) => {
      return transaction.commit().then(() => result)
    }).catch((error) => {
      return transaction.abort().catch((abortError) => {
        if (abortError && (abortError.name === "AbortError")) {
          return 
        }
        console.error("Encountered an unexpected error while trying to " +
            "abort a transaction due to an error", abortError)
      }).then(() => {
        throw error
      })
    })
  }
runTransaction ( operations ) { let transaction = this . startTransaction ( ) return this [ PRIVATE . connection ] . then ( ( ) => { return operations ( transaction ) } ) . then ( ( result ) => { return transaction . commit ( ) . then ( ( ) => result ) } ) . catch ( ( error ) => { return transaction . abort ( ) . catch ( ( abortError ) => { if ( abortError && ( abortError . name === "AbortError" ) ) { return } console . error ( "Encountered an unexpected error while trying to " + "abort a transaction due to an error" , abortError ) } ) . then ( ( ) => { throw error } ) } ) }
The methods starts a new transaction and executes the provided callback
 within it.
The methods starts a new transaction and executes the provided callback within it .
// We must wait for the connection promise to resolve in case the // operations would include merging entities into the persistence context // so that we have the key paths loaded. // transaction successfully aborted