commit (callback) {
    if (typeof callback === 'function') {
      this._commit(err => {
        if (!err) {
          this.emit('commit')
        }
        callback(err)
      })
      return this
    }

    return new shared.Promise((resolve, reject) => {
      this._commit(err => {
        if (err) return reject(err)
        this.emit('commit')
        resolve()
      })
    })
  }
/**
   * Commit a transaction.
   *
   * @param {basicCallback} [callback] A callback which is called after transaction has commited, or an error has occurred. If omited, method returns Promise.
   * @return {Transaction|Promise}
   */
Commit a transaction.
@param {basicCallback} [callback] A callback which is called after transaction has commited, or an error has occurred. If omited, method returns Promise.
@return {Transaction|Promise}
Commit a transaction . @param { basicCallback } [ callback ] A callback which is called after transaction has commited or an error has occurred . If omited method returns Promise . @return { Transaction|Promise }
commit (callback) {
    if (typeof callback === 'function') {
      this._commit(err => {
        if (!err) {
          this.emit('commit')
        }
        callback(err)
      })
      return this
    }
    return new shared.Promise((resolve, reject) => {
      this._commit(err => {
        if (err) return reject(err)
        this.emit('commit')
        resolve()
      })
    })
  }
commit ( callback ) { if ( typeof callback === 'function' ) { this . _commit ( err => { if ( ! err ) { this . emit ( 'commit' ) } callback ( err ) } ) return this } return new shared . Promise ( ( resolve , reject ) => { this . _commit ( err => { if ( err ) return reject ( err ) this . emit ( 'commit' ) resolve ( ) } ) } ) }
Commit a transaction.
Commit a transaction .