prisma / quaint

SQL Query AST and Visitor for Rust
Apache License 2.0
582 stars 62 forks source link

Discard Connection after aborted Transaction #169

Open do4gr opened 4 years ago

do4gr commented 4 years ago

Here we introduced a transaction around DDL operations in order to abort invalid enum migrations. https://github.com/prisma/prisma-engines/pull/1016

When the transaction fails without an explicit rollback being submitted next, the following statement will reuse the same connection and error. See here: https://stackoverflow.com/questions/10399727/psqlexception-current-transaction-is-aborted-commands-ignored-until-end-of-tra

We should look into how Quaint could handle this case.

docteurklein commented 1 year ago

I think I'm hitting this very problem right now. I thought either the PooledConnection or the transaction would be handled with Drop ?

Any idea how to guarantee a correct cleanup?