@prisma/client-engine-runtime 6.11.0-dev.6 → 6.11.0-dev.8
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.
- package/dist/index.js +24 -21
- package/dist/index.mjs +24 -21
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1511,30 +1511,33 @@ var TransactionManager = class {
|
|
|
1511
1511
|
async closeTransaction(tx, status) {
|
|
1512
1512
|
debug("Closing transaction.", { transactionId: tx.id, status });
|
|
1513
1513
|
tx.status = status;
|
|
1514
|
-
|
|
1515
|
-
if (tx.transaction
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1514
|
+
try {
|
|
1515
|
+
if (tx.transaction && status === "committed") {
|
|
1516
|
+
if (tx.transaction.options.usePhantomQuery) {
|
|
1517
|
+
await this.#withQuerySpanAndEvent(PHANTOM_COMMIT_QUERY(), tx.transaction, () => tx.transaction.commit());
|
|
1518
|
+
} else {
|
|
1519
|
+
const query = COMMIT_QUERY();
|
|
1520
|
+
await this.#withQuerySpanAndEvent(query, tx.transaction, () => tx.transaction.executeRaw(query));
|
|
1521
|
+
await tx.transaction.commit();
|
|
1522
|
+
}
|
|
1523
|
+
} else if (tx.transaction) {
|
|
1524
|
+
if (tx.transaction.options.usePhantomQuery) {
|
|
1525
|
+
await this.#withQuerySpanAndEvent(PHANTOM_ROLLBACK_QUERY(), tx.transaction, () => tx.transaction.rollback());
|
|
1526
|
+
} else {
|
|
1527
|
+
const query = ROLLBACK_QUERY();
|
|
1528
|
+
await this.#withQuerySpanAndEvent(query, tx.transaction, () => tx.transaction.executeRaw(query));
|
|
1529
|
+
await tx.transaction.rollback();
|
|
1530
|
+
}
|
|
1521
1531
|
}
|
|
1522
|
-
}
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1532
|
+
} finally {
|
|
1533
|
+
clearTimeout(tx.timer);
|
|
1534
|
+
tx.timer = void 0;
|
|
1535
|
+
this.transactions.delete(tx.id);
|
|
1536
|
+
this.closedTransactions.push(tx);
|
|
1537
|
+
if (this.closedTransactions.length > MAX_CLOSED_TRANSACTIONS) {
|
|
1538
|
+
this.closedTransactions.shift();
|
|
1529
1539
|
}
|
|
1530
1540
|
}
|
|
1531
|
-
clearTimeout(tx.timer);
|
|
1532
|
-
tx.timer = void 0;
|
|
1533
|
-
this.transactions.delete(tx.id);
|
|
1534
|
-
this.closedTransactions.push(tx);
|
|
1535
|
-
if (this.closedTransactions.length > MAX_CLOSED_TRANSACTIONS) {
|
|
1536
|
-
this.closedTransactions.shift();
|
|
1537
|
-
}
|
|
1538
1541
|
}
|
|
1539
1542
|
validateOptions(options) {
|
|
1540
1543
|
if (!options.timeout) throw new TransactionManagerError("timeout is required");
|
package/dist/index.mjs
CHANGED
|
@@ -1463,30 +1463,33 @@ var TransactionManager = class {
|
|
|
1463
1463
|
async closeTransaction(tx, status) {
|
|
1464
1464
|
debug("Closing transaction.", { transactionId: tx.id, status });
|
|
1465
1465
|
tx.status = status;
|
|
1466
|
-
|
|
1467
|
-
if (tx.transaction
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1466
|
+
try {
|
|
1467
|
+
if (tx.transaction && status === "committed") {
|
|
1468
|
+
if (tx.transaction.options.usePhantomQuery) {
|
|
1469
|
+
await this.#withQuerySpanAndEvent(PHANTOM_COMMIT_QUERY(), tx.transaction, () => tx.transaction.commit());
|
|
1470
|
+
} else {
|
|
1471
|
+
const query = COMMIT_QUERY();
|
|
1472
|
+
await this.#withQuerySpanAndEvent(query, tx.transaction, () => tx.transaction.executeRaw(query));
|
|
1473
|
+
await tx.transaction.commit();
|
|
1474
|
+
}
|
|
1475
|
+
} else if (tx.transaction) {
|
|
1476
|
+
if (tx.transaction.options.usePhantomQuery) {
|
|
1477
|
+
await this.#withQuerySpanAndEvent(PHANTOM_ROLLBACK_QUERY(), tx.transaction, () => tx.transaction.rollback());
|
|
1478
|
+
} else {
|
|
1479
|
+
const query = ROLLBACK_QUERY();
|
|
1480
|
+
await this.#withQuerySpanAndEvent(query, tx.transaction, () => tx.transaction.executeRaw(query));
|
|
1481
|
+
await tx.transaction.rollback();
|
|
1482
|
+
}
|
|
1473
1483
|
}
|
|
1474
|
-
}
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1484
|
+
} finally {
|
|
1485
|
+
clearTimeout(tx.timer);
|
|
1486
|
+
tx.timer = void 0;
|
|
1487
|
+
this.transactions.delete(tx.id);
|
|
1488
|
+
this.closedTransactions.push(tx);
|
|
1489
|
+
if (this.closedTransactions.length > MAX_CLOSED_TRANSACTIONS) {
|
|
1490
|
+
this.closedTransactions.shift();
|
|
1481
1491
|
}
|
|
1482
1492
|
}
|
|
1483
|
-
clearTimeout(tx.timer);
|
|
1484
|
-
tx.timer = void 0;
|
|
1485
|
-
this.transactions.delete(tx.id);
|
|
1486
|
-
this.closedTransactions.push(tx);
|
|
1487
|
-
if (this.closedTransactions.length > MAX_CLOSED_TRANSACTIONS) {
|
|
1488
|
-
this.closedTransactions.shift();
|
|
1489
|
-
}
|
|
1490
1493
|
}
|
|
1491
1494
|
validateOptions(options) {
|
|
1492
1495
|
if (!options.timeout) throw new TransactionManagerError("timeout is required");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prisma/client-engine-runtime",
|
|
3
|
-
"version": "6.11.0-dev.
|
|
3
|
+
"version": "6.11.0-dev.8",
|
|
4
4
|
"description": "This package is intended for Prisma's internal use",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
"nanoid": "5.1.5",
|
|
32
32
|
"ulid": "3.0.0",
|
|
33
33
|
"uuid": "11.1.0",
|
|
34
|
-
"@prisma/debug": "6.11.0-dev.
|
|
35
|
-
"@prisma/driver-adapter-utils": "6.11.0-dev.
|
|
34
|
+
"@prisma/debug": "6.11.0-dev.8",
|
|
35
|
+
"@prisma/driver-adapter-utils": "6.11.0-dev.8"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@types/jest": "29.5.14",
|