vapor / fluent-postgres-driver

🐘 PostgreSQL driver for Fluent.
MIT License
149 stars 53 forks source link

Transactions aren't rolling back when closure throws #89

Closed clayellis closed 4 years ago

clayellis commented 6 years ago

The documentation for TransactionSupporting.transactionExecute(_:on:) states:

Closure to run within a database transaction. Errors (throwing or returned by future) should cause a transaction rollback.

Currently, the transaction is only rolled back if the future that the transaction closure returns throws, not if the transaction closure throws (which violates the design according to the documentation.)

PR incoming...