- Only roll-back in the outermost
@db.transaction
decorator/ctx manager if an unhandled exception occurs. Previously, an unhandled exception that occurred in a nestedtransaction
context would trigger a rollback. The use of nestedtransaction
has long been discouraged in the documentation: the recommendation is to always usedb.atomic
, which will use savepoints to properly handle nested blocks. However, the new behavior should make it easier to reason about transaction boundaries - see #2767 for discussion. - Cover transaction
BEGIN
in the reconnect-mixin. Given that no transaction has been started, reconnecting when beginning a new transaction ensures that a reconnect will occur if it is safe to do so. - Add support for setting
isolation_level
indb.atomic()
anddb.transaction()
when using Postgres and MySQL/MariaDB, which will apply to the wrapped transaction. Note: Sqlite has supported a similarlock_type
parameter for some time. - Add support for the Sqlite
SQLITE_DETERMINISTIC
function flag. This allows user-defined Sqlite functions to be used in indexes and may be used by the query planner. - Fix unreported bug in dataset import when inferred field name differs from column name.