@prisma/client-engine-runtime 7.1.0 → 7.2.0-dev.1

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 CHANGED
@@ -2036,14 +2036,16 @@ var TransactionManager = class {
2036
2036
  const abortController = new AbortController();
2037
2037
  const startTimer = createTimeoutIfDefined(() => abortController.abort(), options.maxWait);
2038
2038
  startTimer?.unref?.();
2039
+ const startTransactionPromise = this.driverAdapter.startTransaction(options.isolationLevel).catch(rethrowAsUserFacing);
2039
2040
  transaction.transaction = await Promise.race([
2040
- this.driverAdapter.startTransaction(options.isolationLevel).catch(rethrowAsUserFacing).finally(() => clearTimeout(startTimer)),
2041
+ startTransactionPromise.finally(() => clearTimeout(startTimer)),
2041
2042
  once(abortController.signal, "abort").then(() => void 0)
2042
2043
  ]);
2043
2044
  this.transactions.set(transaction.id, transaction);
2044
2045
  switch (transaction.status) {
2045
2046
  case "waiting":
2046
2047
  if (abortController.signal.aborted) {
2048
+ void startTransactionPromise.then((tx) => tx.rollback()).catch((e) => debug("error in discarded transaction:", e));
2047
2049
  await this.#closeTransaction(transaction, "timed_out");
2048
2050
  throw new TransactionStartTimeoutError();
2049
2051
  }
package/dist/index.mjs CHANGED
@@ -1985,14 +1985,16 @@ var TransactionManager = class {
1985
1985
  const abortController = new AbortController();
1986
1986
  const startTimer = createTimeoutIfDefined(() => abortController.abort(), options.maxWait);
1987
1987
  startTimer?.unref?.();
1988
+ const startTransactionPromise = this.driverAdapter.startTransaction(options.isolationLevel).catch(rethrowAsUserFacing);
1988
1989
  transaction.transaction = await Promise.race([
1989
- this.driverAdapter.startTransaction(options.isolationLevel).catch(rethrowAsUserFacing).finally(() => clearTimeout(startTimer)),
1990
+ startTransactionPromise.finally(() => clearTimeout(startTimer)),
1990
1991
  once(abortController.signal, "abort").then(() => void 0)
1991
1992
  ]);
1992
1993
  this.transactions.set(transaction.id, transaction);
1993
1994
  switch (transaction.status) {
1994
1995
  case "waiting":
1995
1996
  if (abortController.signal.aborted) {
1997
+ void startTransactionPromise.then((tx) => tx.rollback()).catch((e) => debug("error in discarded transaction:", e));
1996
1998
  await this.#closeTransaction(transaction, "timed_out");
1997
1999
  throw new TransactionStartTimeoutError();
1998
2000
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prisma/client-engine-runtime",
3
- "version": "7.1.0",
3
+ "version": "7.2.0-dev.1",
4
4
  "description": "This package is intended for Prisma's internal use",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -30,10 +30,10 @@
30
30
  "nanoid": "5.1.5",
31
31
  "ulid": "3.0.0",
32
32
  "uuid": "11.1.0",
33
- "@prisma/client-runtime-utils": "7.1.0",
34
- "@prisma/debug": "7.1.0",
35
- "@prisma/driver-adapter-utils": "7.1.0",
36
- "@prisma/sqlcommenter": "7.1.0"
33
+ "@prisma/client-runtime-utils": "7.2.0-dev.1",
34
+ "@prisma/debug": "7.2.0-dev.1",
35
+ "@prisma/sqlcommenter": "7.2.0-dev.1",
36
+ "@prisma/driver-adapter-utils": "7.2.0-dev.1"
37
37
  },
38
38
  "devDependencies": {
39
39
  "@types/jest": "29.5.14",