* Commits the transaction bound to this EntityManager. Flushes before doing the actual commit query.
()
| 1710 | * Commits the transaction bound to this EntityManager. Flushes before doing the actual commit query. |
| 1711 | */ |
| 1712 | async commit(): Promise<void> { |
| 1713 | const em = this.getContext(false); |
| 1714 | |
| 1715 | if (this.#disableTransactions) { |
| 1716 | await em.flush(); |
| 1717 | return; |
| 1718 | } |
| 1719 | |
| 1720 | if (!em.#transactionContext) { |
| 1721 | throw ValidationError.transactionRequired(); |
| 1722 | } |
| 1723 | |
| 1724 | await em.flush(); |
| 1725 | await em.getConnection('write').commit(em.#transactionContext, new TransactionEventBroadcaster(em)); |
| 1726 | em.#transactionContext = undefined; |
| 1727 | } |
| 1728 | |
| 1729 | /** |
| 1730 | * Rollbacks the transaction bound to this EntityManager. |
nothing calls this directly
no test coverage detected