diff --git a/content/400-reference/200-api-reference/050-prisma-client-reference.mdx b/content/400-reference/200-api-reference/050-prisma-client-reference.mdx index f6726d6ea9..cf6f9dc17d 100644 --- a/content/400-reference/200-api-reference/050-prisma-client-reference.mdx +++ b/content/400-reference/200-api-reference/050-prisma-client-reference.mdx @@ -954,6 +954,7 @@ const user = await prisma.user.update({ #### Remarks - To perform arithmetic operations on update (add, subtract, multiply, divide), use [atomic updates](#atomic-number-operations) to prevent race conditions. +- Prisma performs the upsert first executing a `SELECT` query to check if the record exists, followed by an `INSERT` or `UPDATE` query depending on the result of the `SELECT` query. Since it does not use the `ON CONFLICT` or the `ON DUPLICATE KEY` clause, [two simultaneous upserts on the same record can result in a “Unique constraint failed” error](https://github.com/prisma/prisma/issues/3242). It is your application’s responsibility to handle the [P2002](error-reference#p2002) error and retry the upsert. #### Reference