Prisma transaction cannot read its own writes when mixing standard and raw queries.
Hello! I am using Prisma 5.21.0 with Postgres 15.5.
I've noticed that when I create a transaction, writes performed with
$executeRaw are not seen by queries made using the standard ORM interface and vice-versa. Looking at the logs for my postgres service shows that these queries have a different postgres Process ID, whereas all standard ORM calls within a transaction have the same Process ID.
For example:
In the above code block, retUser will have its old name. queryRaw has the same behavior, with and without Prisma.sql templating.
Is this expected?3 Replies
You selected to wait for the human sages. They'll share their wisdom soon.
Grab some tea while you wait, or check out
#ask-ai if you'd like a quick chat with the bot anyway!Anyone see this before?
Hey!
Can you let me know if this occurs in latest prisma version 6.12 as well?