question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

When transaction API used for update => Error: In order to use the .transaction() api, please enable 'experimentalFeatures = "transactionApi" in your schema.

See original GitHub issue

TransactionAPI currently does not support update action.

Bug description

The transaction API works well for create. But throws an error when tried with update action Error: In order to use the .transaction() api, please enable 'experimentalFeatures = "transactionApi" in your schema. at NewPrismaClient.transaction (C:\Program Files\EA_HOME\GraphQL\essential-node\node_modules\@prisma\client\runtime\index.js:1:202012) at C:\Program Files\EA_HOME\GraphQL\essential-node\src\script.js:673:28 at runMicrotasks (<anonymous>) at processTicksAndRejections (internal/process/task_queues.js:93:5)

How to reproduce

Steps to reproduce the behavior:

  1. schema.prisma previewFeatures = ["connectOrCreate", "transactionApi", "distinct"] experimentalFeatures = ["transactionApi"]
  2. Create an array of update tasks to use with transaction API
  3. Run the transactional update
  4. Error

In order to use the .transaction() api, please enable 'experimentalFeatures = "transactionApi" in your schema. at NewPrismaClient.transaction (C:\Program Files\EA_HOME\GraphQL\essential-node\node_modules\@prisma\client\runtime\index.js:1:202012) at C:\Program Files\EA_HOME\GraphQL\essential-node\src\script.js:673:28 at runMicrotasks (<anonymous>)

Expected behavior

Prisma information

Environment & setup

  • OS: windows
  • Database: SQLite
  • Node.js version: v14.5.0
  • Prisma version: @prisma/cli : 2.4.1 Current platform : windows Query Engine : query-engine 195d4bdc2d16132977f4ba7a8ca312f7906cb086 (at node_modules\@prisma\cli\query-engine-windows.exe) Migration Engine : migration-engine-cli 195d4bdc2d16132977f4ba7a8ca312f7906cb086 (at node_modules\@prisma\cli\migration-engine-windows.exe) Introspection Engine : introspection-core 195d4bdc2d16132977f4ba7a8ca312f7906cb086 (at node_modules\@prisma\cli\introspection-engine-windows.exe) Format Binary : prisma-fmt 195d4bdc2d16132977f4ba7a8ca312f7906cb086 (at node_modules\@prisma\cli\prisma-fmt-windows.exe) Preview Features : connectOrCreate, transactionApi, distinct

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:12 (9 by maintainers)

github_iconTop GitHub Comments

2reactions
Syttencommented, Aug 21, 2020

Maybe the error need to be clearer, something like: a resolved operation was passed to the transaction, please dont do that.

1reaction
pantharshit00commented, Aug 21, 2020

@janpio I am not sure how we can possibly detect a query that user intends to use inside of a transaction without a linter like eslint.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Transactions - Prisma
Explore techniques for handling transactions with Prisma Client. ... Why can't I use the $transaction API to solve the same problem? The $transaction...
Read more >
API - Transactions | Plaid Docs
The /transactions/sync endpoint allows developers to subscribe to all transactions associated with an Item and get updates synchronously in a stream-like manner ...
Read more >
Transaction API - USAePay Help
The gateway API can be accessed in two ways, server-side or client-side, depending on the capabilities of your scripting/cgi platform.
Read more >
Transactional messages | Customer.io Docs
In Customer.io you use our Transactional API to send these messages. How it works. A transactional message is a message your audience implicitly ......
Read more >
Troubleshooting physical transactions | Actions on Google ...
Actions with Transactions will continue to work in all supported ... order update for an existing order, the Orders API responds with error...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found