Version: 4.3

Class: TransactionContext

Hierarchy

  • TransactionContext

Constructors

constructor

+ new TransactionContext(em: EntityManager): TransactionContext

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

Parameters:

NameType
emEntityManager

Returns: TransactionContext

Properties

em

Readonly em: EntityManager

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


id

Readonly id: number = this.em.id

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

Methods

createAsync

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

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

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

Type parameters:

Name
T

Parameters:

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

Returns: Promise<T>


currentTransactionContext

StaticcurrentTransactionContext(): TransactionContext | undefined

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

Returns current TransactionContext (if available).

Returns: TransactionContext | undefined


getEntityManager

StaticgetEntityManager(): EntityManager | undefined

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

Returns current EntityManager (if available).

Returns: EntityManager | undefined

Last updated on by Martin Adámek