Do not commit new transaction for database error processing
When working on !1340 (merged), I got a strange behavior with the party tests. The parties of test_party_code
were stored in the table even after the transaction rollback.
This happened during development when the SQLite integrity errors were not converted into SQLConstraintError
.
This is because a new transaction is created to raise the database error but on :memory:
SQLite database, it is always the same connection that is used. So when exiting the new transaction without an exception raised, the new transaction is committed which means that the single :memory:
connection is committed.