Class DBTransaction

Hierarchy

  • CreateDestroy
    • DBTransaction

Constructors

  • Parameters

    • __namedParameters: {
          db: DB;
          lockBox: LockBox<RWLockWriter>;
          locksPending?: Map<string, {
              count: number;
          }>;
          logger?: Logger;
      } & RocksDBPutOptions

    Returns DBTransaction

Properties

[initLock]: RWLockWriter
_callbacksFailure: ((e?) => any)[] = []

Type declaration

    • (e?): any
    • Parameters

      • Optional e: Error

      Returns any

_callbacksFinally: ((e?) => any)[] = []

Type declaration

    • (e?): any
    • Parameters

      • Optional e: Error

      Returns any

_callbacksSuccess: (() => any)[] = []

Type declaration

    • (): any
    • Returns any

_committed: boolean = false
_committing: boolean = false
_db: DB
_iteratorRefs: Set<DBIterator<any, any>> = ...
_rollbacked: boolean = false
_rollbacking: boolean = false
_transaction: RocksDBTransaction
commitOrRollbackLock: Lock = ...
id: number
logger: Logger
monitor: Monitor<RWLockWriter>

Accessors

  • get [destroyed](): boolean
  • Returns boolean

  • get [eventHandled](): WeakSet<Event>
  • Returns WeakSet<Event>

  • get [eventHandlers](): WeakMap<EventListenerOrEventListenerObject, EventListener>
  • Returns WeakMap<EventListenerOrEventListenerObject, EventListener>

  • get [eventTarget](): EventTarget
  • Returns EventTarget

  • get [status](): Status
  • Returns Status

  • get committed(): boolean
  • Indicates when the transaction is committed

    Returns boolean

  • get committing(): boolean
  • Indicates when this.commit is first called

    Returns boolean

  • get locks(): ReadonlyMap<string, {
        status: "acquiring";
        type: "read" | "write";
    } | {
        lock: RWLockWriter;
        release: ResourceRelease;
        status: "acquired";
        type: "read" | "write";
    }>
  • Returns ReadonlyMap<string, {
        status: "acquiring";
        type: "read" | "write";
    } | {
        lock: RWLockWriter;
        release: ResourceRelease;
        status: "acquired";
        type: "read" | "write";
    }>

  • get rollbacked(): boolean
  • Indicates when the transaction is rollbacked

    Returns boolean

  • get rollbacking(): boolean
  • Indicates when this.rollback is first called

    Returns boolean

Methods

  • Parameters

    • type: string
    • callback: null | EventListenerOrEventListenerObject
    • Optional options: boolean | AddEventListenerOptions

    Returns void

  • Parameters

    • keyPath: string | Buffer | readonly (string | Buffer)[]

    Returns Promise<void>

  • Destroy the transaction This cannot be called until the transaction is committed or rollbacked

    Returns Promise<void>

  • Parameters

    • event: Event

    Returns boolean

  • Dump from transaction level path This will only show entries for the current transaction It is intended for diagnostics

    Type Parameters

    • V

    Parameters

    • Optional levelPath: readonly (string | Buffer)[]
    • Optional raw: false

    Returns Promise<[readonly (string | Buffer)[], V][]>

  • Parameters

    • levelPath: undefined | readonly (string | Buffer)[]
    • raw: true

    Returns Promise<[readonly (string | Buffer)[], Buffer][]>

  • Type Parameters

    • T

    Parameters

    • keyPath: string | Buffer | readonly (string | Buffer)[]
    • Optional raw: false

    Returns Promise<undefined | T>

  • Parameters

    • keyPath: string | Buffer | readonly (string | Buffer)[]
    • raw: true

    Returns Promise<undefined | Buffer>

  • Use this for to address write skews

    Type Parameters

    • T

    Parameters

    • keyPath: string | Buffer | readonly (string | Buffer)[]
    • Optional raw: false

    Returns Promise<undefined | T>

  • Parameters

    • keyPath: string | Buffer | readonly (string | Buffer)[]
    • raw: true

    Returns Promise<undefined | Buffer>

  • Parameters

    • Rest ...params: (string | RWLockRequest)[] | [...requests: (string | RWLockRequest)[], ctx: Partial<ContextTimedInput>] | [ctx?: Partial<ContextTimedInput>]

    Returns Promise<void>

  • Parameters

    • keyPath: string | Buffer | readonly (string | Buffer)[]
    • value: any
    • Optional raw: false

    Returns Promise<void>

  • Parameters

    • keyPath: string | Buffer | readonly (string | Buffer)[]
    • value: Buffer
    • raw: true

    Returns Promise<void>

  • Parameters

    • f: ((e?) => any)
        • (e?): any
        • Parameters

          • Optional e: Error

          Returns any

    Returns void

  • Parameters

    • f: ((e?) => any)
        • (e?): any
        • Parameters

          • Optional e: Error

          Returns any

    Returns void

  • Parameters

    • type: string
    • callback: null | EventListenerOrEventListenerObject
    • Optional options: boolean | EventListenerOptions

    Returns void

  • Set the snapshot manually This ensures that consistent reads and writes start after this method is executed This is idempotent Note that normally snapshots are set lazily upon the first transaction db operation

    Returns void

  • Parameters

    • Rest ...params: string[]

    Returns Promise<void>

Generated using TypeDoc