Skip to main content
Version: 4.4

Class: TransactionContext#

core.TransactionContext

Hierarchy#

  • TransactionContext

Constructors#

constructor#

+ new TransactionContext(em: EntityManager<IDatabaseDriver<Connection>>): TransactionContext

Parameters:#

NameType
emEntityManager<IDatabaseDriver<Connection>>

Returns: TransactionContext

Defined in: packages/core/src/utils/TransactionContext.ts:9

Properties#

em#

Readonly em: EntityManager<IDatabaseDriver<Connection>>


id#

Readonly id: number

Defined in: packages/core/src/utils/TransactionContext.ts:9

Methods#

createAsync#

StaticcreateAsync<T>(em: EntityManager<IDatabaseDriver<Connection>>, next: (...args: any[]) => Promise<T>): Promise<T>

Creates new TransactionContext instance and runs the code inside its domain.

Type parameters:#

Name
T

Parameters:#

NameType
emEntityManager<IDatabaseDriver<Connection>>
next(...args: any[]) => Promise<T>

Returns: Promise<T>

Defined in: packages/core/src/utils/TransactionContext.ts:16


currentTransactionContext#

StaticcurrentTransactionContext(): undefined | TransactionContext

Returns current TransactionContext (if available).

Returns: undefined | TransactionContext

Defined in: packages/core/src/utils/TransactionContext.ts:31


getEntityManager#

StaticgetEntityManager(): undefined | EntityManager<IDatabaseDriver<Connection>>

Returns current EntityManager (if available).

Returns: undefined | EntityManager<IDatabaseDriver<Connection>>

Defined in: packages/core/src/utils/TransactionContext.ts:39

Last updated on by renovate[bot]