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?
optionaldatasource?: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?
optionalentityManager?:any
Defined in: service-core/src/decorators/DatabaseDecorators.ts:16
The TypeORM-specific entity manager to perform all operations with.
onRollback?
optionalonRollback?: () =>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?
optionalsession?:any
Defined in: service-core/src/decorators/DatabaseDecorators.ts:14
The MongoDB-specific session object to pass in to MongoRepository for each operation.