Options
All
  • Public
  • Public/Protected
  • All
Menu

Represents a pooled session object. See QldbSessionImpl for more details.

Hierarchy

  • PooledQldbSession

Implements

Index

Constructors

constructor

Properties

Private _isClosed

_isClosed: boolean

Private _returnSessionToPool

_returnSessionToPool: function

Type declaration

Private _session

_session: QldbSessionImpl

Methods

Private _throwIfClosed

  • _throwIfClosed(): void

close

  • close(): void

executeLambda

  • executeLambda(queryLambda: function, retryIndicator?: function): Promise<any>
  • Implicitly start a transaction, execute the lambda, and commit the transaction, retrying up to the retry limit if an OCC conflict or retriable exception occurs.

    throws

    SessionClosedError when this session is closed.

    Parameters

    • queryLambda: function

      A lambda representing the block of code to be executed within the transaction. This cannot have any side effects as it may be invoked multiple times, and the result cannot be trusted until the transaction is committed.

    • Optional retryIndicator: function

      An optional lambda that is invoked when the querylambda is about to be retried due to an OCC conflict or retriable exception.

        • (retryAttempt: number): void
        • Parameters

          • retryAttempt: number

          Returns void

    Returns Promise<any>

    Promise which fulfills with the return value of the queryLambda which could be a Result on the result set of a statement within the lambda.

getLedgerName

  • getLedgerName(): string
  • Return the name of the ledger for the session.

    Returns string

    Returns the name of the ledger as a string.

getSessionToken

  • getSessionToken(): string
  • Return the session token for this session.

    Returns string

    Returns the session token as a string.

getTableNames

  • getTableNames(): Promise<string[]>
  • Lists all tables in the ledger.

    Returns Promise<string[]>

    Promise which fulfills with an array of table names.

startTransaction

Generated using TypeDoc