sql

All things SQL and JDBC...
souenzzo 2020-05-28T19:10:24.091500Z

Hello I'm trying to write some test-fixtures to run my app and rollback after the test but I'm getting: ERROR: ROLLBACK TO SAVEPOINT can only be used in transaction blocks If it's really not possible, I would ask at least some more info about transaction blocks (and how they compose) https://gist.github.com/souenzzo/2783a30bc8d5b904a7b1e0ecf8cbe082

seancorfield 2020-05-28T19:16:24.091700Z

Transactions cannot be nested.

seancorfield 2020-05-28T19:17:39.092400Z

You're also trying to stand up two overlapping transactions on a single connection which cannot work.

seancorfield 2020-05-28T19:19:06.093500Z

Connections are auto-commit by default so single SQL operations do not need to be wrapped in a transaction -- you only need a (single) transaction wrapped around a group of SQL operations that you need to be atomically committed (or rolled back).

seancorfield 2020-05-28T19:20:24.093700Z

^ @souenzzo