N
Neon13mo ago
optimistic-gold

How are we able to rollback transactions

How are we able to rollback transactions made within the Neon rest api?
14 Replies
genetic-orange
genetic-orange13mo ago
Do you mind sharing more details? What type of transactions?
wise-white
wise-white13mo ago
SQL transactions. For example - An external API request failed - Rollback internal postgres commits
genetic-orange
genetic-orange13mo ago
So the Neon REST API is used to manage resources (e.g. projects, branches, etc.) Transactions where you do BEGIN..COMMIT..ROLLBACK are supported at the database level
wise-white
wise-white13mo ago
I'm referencing the Neon REST API for interfacting with the database directly
genetic-orange
genetic-orange13mo ago
hmm, which one exactly can you share a link?
wise-white
wise-white13mo ago
Trying to find it in our codebase now <databaseurl>/sql
genetic-orange
genetic-orange13mo ago
Typically you would be using the Neon Serverless Driver and you wouldn't be querying the endpoint directly, which is why I was confused haha. Transactions aren't supported when querying your database this way You would need to use a regular Postgres driver
wise-white
wise-white13mo ago
Issue is simply that the Serverless Driver doesn't support Java Ah so even if we could use the serverless driver it wouldn't support it Is that right?
genetic-orange
genetic-orange13mo ago
yup
wise-white
wise-white13mo ago
That is really quite unfortunate - is it in anyway possible to properly handle rollbacks without these transactions?
genetic-orange
genetic-orange13mo ago
Unfortunately no you would need to write the rollback logic
wise-white
wise-white13mo ago
yikes. Is their any plan for future support?
genetic-orange
genetic-orange13mo ago
Unfortunately no plans to support transactions when connecting over HTTP. You need a regular postgres connection to be able to use transactions

Did you find this page helpful?