begin (isolationLevel, callback) {
    if (isolationLevel instanceof Function) {
      callback = isolationLevel
      isolationLevel = undefined
    }

    if (typeof callback === 'function') {
      this._begin(isolationLevel, err => {
        if (!err) {
          this.emit('begin')
        }
        callback(err)
      })
      return this
    }

    return new shared.Promise((resolve, reject) => {
      this._begin(isolationLevel, err => {
        if (err) return reject(err)
        this.emit('begin')
        resolve(this)
      })
    })
  }
/**
   * Begin a transaction.
   *
   * @param {Number} [isolationLevel] Controls the locking and row versioning behavior of TSQL statements issued by a connection.
   * @param {basicCallback} [callback] A callback which is called after transaction has began, or an error has occurred. If omited, method returns Promise.
   * @return {Transaction|Promise}
   */
Begin a transaction.
@param {Number} [isolationLevel] Controls the locking and row versioning behavior of TSQL statements issued by a connection.
@param {basicCallback} [callback] A callback which is called after transaction has began, or an error has occurred. If omited, method returns Promise.
@return {Transaction|Promise}
Begin a transaction . @param { Number } [ isolationLevel ] Controls the locking and row versioning behavior of TSQL statements issued by a connection . @param { basicCallback } [ callback ] A callback which is called after transaction has began or an error has occurred . If omited method returns Promise . @return { Transaction|Promise }
begin (isolationLevel, callback) {
    if (isolationLevel instanceof Function) {
      callback = isolationLevel
      isolationLevel = undefined
    }
    if (typeof callback === 'function') {
      this._begin(isolationLevel, err => {
        if (!err) {
          this.emit('begin')
        }
        callback(err)
      })
      return this
    }
    return new shared.Promise((resolve, reject) => {
      this._begin(isolationLevel, err => {
        if (err) return reject(err)
        this.emit('begin')
        resolve(this)
      })
    })
  }
begin ( isolationLevel , callback ) { if ( isolationLevel instanceof Function ) { callback = isolationLevel isolationLevel = undefined } if ( typeof callback === 'function' ) { this . _begin ( isolationLevel , err => { if ( ! err ) { this . emit ( 'begin' ) } callback ( err ) } ) return this } return new shared . Promise ( ( resolve , reject ) => { this . _begin ( isolationLevel , err => { if ( err ) return reject ( err ) this . emit ( 'begin' ) resolve ( this ) } ) } ) }
Begin a transaction.
Begin a transaction .