* Starts new transaction bound to this EntityManager. Use `ctx` parameter to provide the parent when nesting transactions.
(options: Omit<TransactionOptions, 'ignoreNestedTransactions'> = {})
| 1695 | * Starts new transaction bound to this EntityManager. Use `ctx` parameter to provide the parent when nesting transactions. |
| 1696 | */ |
| 1697 | async begin(options: Omit<TransactionOptions, 'ignoreNestedTransactions'> = {}): Promise<void> { |
| 1698 | if (this.#disableTransactions) { |
| 1699 | return; |
| 1700 | } |
| 1701 | |
| 1702 | const em = this.getContext(false); |
| 1703 | em.#transactionContext = await em.getConnection('write').begin({ |
| 1704 | ...options, |
| 1705 | eventBroadcaster: new TransactionEventBroadcaster(em, { topLevelTransaction: !options.ctx }), |
| 1706 | }); |
| 1707 | } |
| 1708 | |
| 1709 | /** |
| 1710 | * Commits the transaction bound to this EntityManager. Flushes before doing the actual commit query. |
no test coverage detected