Hey, I have a question regarding the $transaction ...
# orm-help
k
Hey, I have a question regarding the $transaction API. Let's presume there is two sequential queries wrapped like following
const [queryOne, queryTwo] = await prisma.$transaction([])
The transaction will fail if one of them fails but what happens if one of them succeed and the other fails? Will the query that succeeded actually run towards the DB even though the other query failed?
1
j
It will rollback both queries because they use the same transaction id to process with the same isolation level https://www.prisma.io/dataguide/postgresql/inserting-and-modifying-data/using-transactions
💯 1
🙌 1
k
Great, thanks for clarifying
r
Thanks Jarupong for helping out here.
💚 2