SIGN IN SIGN UP

set_rollback should only rollback initialized connections (#9599)

* set_roll_back should only rollback initialized connections

The exception handler call "connections.all()". This creates a database connection to all defined databases. 
As a small optimization you can use "connections.all(initialized_only=True)" to rollback only the database to which the current thread has open connections.

(My application can have many databases defined, and this loop is identified as a source of many idle database connections)

* Add regression test for the change

---------

Co-authored-by: Asif Saif Uddin {"Auvi":"অভি"} <auvipy@gmail.com>
Co-authored-by: Bruno Alla <alla.brunoo@gmail.com>
J
Johan De Taeye committed
dc027d2bb41c3858fc2fc95bf2b04b33f0cdc5be
Parent: 094bb6d
Committed by GitHub <noreply@github.com> on 8/5/2026, 4:45:27 PM