At the moment, We do not have support for manually rolling back a transaction. There is an open feature request to support this behaviour. You may also want to check this workaround in that same issue. You can also take a look at this other issue with a suggested workaround.
Problem To rollback an interactive transaction, you have to throw an error. It would be awesome to have a manual rollback function (that potentially takes a data argument to pass back to the parent...
Problem Since Prisma does not offer manual transaction rollbacks which is one the reason TypeORM is preferred by users over Prisma. I intended to perform an E2E test on the production database, but...
you can bypass it but using native sql > when you use the prisma transaction and somewhere you want to rollback, just use await prisma.$executeRaw; where prisma is your transactional instance