DBIO-MySQL
view release on metacpan or search on metacpan
docs/adr/0005-auto-reconnect-disabled-by-default.md view on Meta::CPAN
# ADR 0005 â `auto_reconnect` is forced off by default
- Status: accepted
- Date: 2026-06-20
- Tags: storage, transactions, safety, mariadb, backfill
## Context
`DBD::mysql` and `DBD::MariaDB` can transparently reconnect a dropped
connection mid-session (`mysql_auto_reconnect` / `mariadb_auto_reconnect`).
That is convenient for fire-and-forget scripts but catastrophic for a
transactional ORM: a silent reconnect inside an open transaction restarts the
session on a *fresh* connection, so the in-flight transaction is gone, locks
are released, and `SET`-based session state (strict mode, `FOREIGN_KEY_CHECKS`,
savepoints) evaporates â with no error surfaced to the application. The work
appears to continue and quietly commits outside the intended transaction
boundary.
DBIx::Class disabled this for the same reason. DBIO must preserve that safety
( run in 0.826 second using v1.01-cache-2.11-cpan-600a1bdf6e4 )