N
Neon15mo ago
deep-jade

How are we able to rollback transactions

How are we able to rollback transactions made within the Neon rest api?
14 Replies
stormy-gold
stormy-gold15mo ago
Do you mind sharing more details? What type of transactions?
exotic-emerald
exotic-emerald15mo ago
SQL transactions. For example - An external API request failed - Rollback internal postgres commits
stormy-gold
stormy-gold15mo 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
exotic-emerald
exotic-emerald15mo ago
I'm referencing the Neon REST API for interfacting with the database directly
stormy-gold
stormy-gold15mo ago
hmm, which one exactly can you share a link?
exotic-emerald
exotic-emerald15mo ago
Trying to find it in our codebase now <databaseurl>/sql
stormy-gold
stormy-gold15mo 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
exotic-emerald
exotic-emerald15mo 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?
stormy-gold
stormy-gold15mo ago
yup
exotic-emerald
exotic-emerald15mo ago
That is really quite unfortunate - is it in anyway possible to properly handle rollbacks without these transactions?
stormy-gold
stormy-gold15mo ago
Unfortunately no you would need to write the rollback logic
exotic-emerald
exotic-emerald15mo ago
yikes. Is their any plan for future support?
stormy-gold
stormy-gold15mo 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?