@mikro-orm/sql 7.2.6-dev.19 → 7.2.6-dev.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -130,6 +130,10 @@ export class AbstractSqlConnection extends Connection {
130
130
  }
131
131
  catch (rollbackError) {
132
132
  this.logger.warn('query', `Failed to roll back transaction: ${rollbackError.message}`);
133
+ // the inner writes are still part of the outer transaction, so it must not commit them
134
+ if (options.ctx) {
135
+ options.ctx.failedSavepointRollback ??= new Error(`Cannot commit the transaction, rolling back to savepoint "${trx.savepointName}" failed: ${rollbackError.message}`, { cause: rollbackError });
136
+ }
133
137
  }
134
138
  throw error;
135
139
  }
@@ -203,6 +207,9 @@ export class AbstractSqlConnection extends Connection {
203
207
  if (ctx.isRolledBack) {
204
208
  return;
205
209
  }
210
+ if ('failedSavepointRollback' in ctx) {
211
+ throw ctx.failedSavepointRollback;
212
+ }
206
213
  await eventBroadcaster?.dispatchEvent(EventType.beforeTransactionCommit, ctx);
207
214
  if ('savepointName' in ctx) {
208
215
  await ctx.releaseSavepoint(ctx.savepointName).execute();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mikro-orm/sql",
3
- "version": "7.2.6-dev.19",
3
+ "version": "7.2.6-dev.20",
4
4
  "description": "TypeScript ORM for Node.js based on Data Mapper, Unit of Work and Identity Map patterns. Supports MongoDB, MySQL, PostgreSQL and SQLite databases as well as usage with vanilla JavaScript.",
5
5
  "keywords": [
6
6
  "data-mapper",
@@ -53,7 +53,7 @@
53
53
  "@mikro-orm/core": "^7.2.5"
54
54
  },
55
55
  "peerDependencies": {
56
- "@mikro-orm/core": "7.2.6-dev.19"
56
+ "@mikro-orm/core": "7.2.6-dev.20"
57
57
  },
58
58
  "engines": {
59
59
  "node": ">= 22.17.0"