Skip to main content

Interface: TransactionContext

Defined in: service-core/src/decorators/DatabaseDecorators.ts:12

The transactional context (session and/or entityManager) established by @Transactional, if any.

Properties

datasource?

optional datasource?: string

Defined in: service-core/src/decorators/DatabaseDecorators.ts:18

The datasource name this context's session/entityManager belongs to, used to guard merging (see Transactional).


entityManager?

optional entityManager?: any

Defined in: service-core/src/decorators/DatabaseDecorators.ts:16

The TypeORM-specific entity manager to perform all operations with.


onRollback?

optional onRollback?: () => Promise<void>[]

Defined in: service-core/src/decorators/DatabaseDecorators.ts:24

Best-effort compensating actions to run if this transaction ultimately fails, populated via registerRollbackHook(). Owned by whichever @Transactional call actually opened the real transaction (nested/merged calls share the same array via the ambient context, rather than each getting their own).

Returns

Promise<void>


session?

optional session?: any

Defined in: service-core/src/decorators/DatabaseDecorators.ts:14

The MongoDB-specific session object to pass in to MongoRepository for each operation.