Prisma ORM

Lesson 05 · 10 min

Transactions and performance

$transaction is all or nothing. And one client for the whole app.

10 minLesson 5 of 9Practice includedAsk AI on any point

prisma.$transaction(async (tx) => { … }) runs every query through tx in one transaction: an error inside cancels everything. For simple cases there's an array form: $transaction([a, b]). Atomic updates like { increment: 1 } avoid races without a transaction.

Sign in to continue

The rest of this lesson opens after sign up

The first lesson of every course is open without an account. To read on, solve the practice and use Ask, create a free account or log in.