From 2aa9f32ceffea8cb0128bdec9814eed80b6a2ba6 Mon Sep 17 00:00:00 2001 From: Konstantin Wohlwend Date: Sat, 27 Dec 2025 20:45:57 +0100 Subject: [PATCH] Deprecate retryTransaction --- apps/backend/src/prisma-client.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/backend/src/prisma-client.tsx b/apps/backend/src/prisma-client.tsx index fc0f8e208..c2061c504 100644 --- a/apps/backend/src/prisma-client.tsx +++ b/apps/backend/src/prisma-client.tsx @@ -217,6 +217,9 @@ class TransactionErrorThatShouldNotBeRetried extends Error { } } +/** + * @deprecated Prisma transactions are slow and lock the database. Use rawQuery with CTEs instead. Ask Konsti if you're confused or think you need transactions. + */ export async function retryTransaction(client: Omit, fn: (tx: PrismaClientTransaction) => Promise, options: { level?: "default" | "serializable" } = {}): Promise { // serializable transactions are currently off by default, later we may turn them on const enableSerializable = options.level === "serializable";