Skip to content
Discussion options

You must be logged in to vote

Hey @Tseredian 👋 The error is correct, you cannot nest a $transaction in a batch $transaction this way. So if that worked, it was most likely a bug because this error message exists for a long time. That said, I am here to help you!

First of all, a PrismaPromise represents anything that will issue a query. So that is all the raw queries as well as all the model queries. PrismaPromises can be chained on (ie. fluent API) on models, but most importantly they provide a way to inject them with a transaction context - be it in interactive transactions or in batch transactions. $transaction does not return a PrismaPromise, so you cannot nest them.

In other words, because your queries are already…

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
4 replies
@Tseredian
Comment options

@millsp
Comment options

@Tseredian
Comment options

@millsp
Comment options

Answer selected by Tseredian
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants