ITransactionalEntityManagerSource
Defined in: packages/mikro-orm/src/cache/mikro-orm.cache.ts:81
Supplies the MikroORM EntityManager for the current operation.
AggregateRepository and MikroOrmCache read em on every
operation and never keep it, so a source may return a different manager each
time: the current tenant’s in a multi-tenant application, or the current
request’s. A getter over the application’s own store satisfies it, and so
does a plain { em } object in a single-database setup or a test.
Example
Section titled “Example”Extends
Section titled “Extends”Properties
Section titled “Properties”
readonlyem:EntityManager
Defined in: packages/mikro-orm/src/interfaces/entity-manager-source.ts:20
Inherited from
Section titled “Inherited from”Methods
Section titled “Methods”transactional()
Section titled “transactional()”transactional<
T>(work):Promise<T>
Defined in: packages/mikro-orm/src/cache/mikro-orm.cache.ts:83
Type Parameters
Section titled “Type Parameters”T
Parameters
Section titled “Parameters”(em) => Promise<T>
Returns
Section titled “Returns”Promise<T>