()
| 156 | } |
| 157 | |
| 158 | async commit(): Promise<void> { |
| 159 | if (this.#finished) { |
| 160 | throw new Error('Transaction already finished') |
| 161 | } |
| 162 | |
| 163 | try { |
| 164 | await this.#ensureBegun() |
| 165 | await this.#session.query('COMMIT') |
| 166 | this.#finished = true |
| 167 | } catch (error) { |
| 168 | throw convertDriverError(error) |
| 169 | } finally { |
| 170 | this.#session.close() |
| 171 | } |
| 172 | } |
| 173 | |
| 174 | async rollback(): Promise<void> { |
| 175 | if (this.#finished) { |
nothing calls this directly
no test coverage detected