You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Scenarios where a transaction instance is deleted without calling .commit() or .rollback() (perhaps because a database or connection is being garbage collected) are possible if users are using the documented low-level transaction management API, and they didn't set up their try/except/else logic correctly.
I consider this user-error, but it also makes sense that this hangs on shutdown. From the database driver's perspective, there is an open transaction that has not executed a COMMIT or ROLLBACK statement, better wait for that to happen before shutting down.
The best thing databases could do here is to emit a warning if __del__ (?) is called on a connection with entries that remain in it's ._transaction_stack. Maybe even each of those transactions could have a .rollback() applied to them.
The text was updated successfully, but these errors were encountered:
Originally posted by @zevisert in #546 (comment)
Scenarios where a transaction instance is deleted without calling
.commit()
or.rollback()
(perhaps because a database or connection is being garbage collected) are possible if users are using the documented low-level transaction management API, and they didn't set up their try/except/else logic correctly.I consider this user-error, but it also makes sense that this hangs on shutdown. From the database driver's perspective, there is an open transaction that has not executed a COMMIT or ROLLBACK statement, better wait for that to happen before shutting down.
The best thing databases could do here is to emit a warning if
__del__
(?) is called on a connection with entries that remain in it's._transaction_stack
. Maybe even each of those transactions could have a.rollback()
applied to them.The text was updated successfully, but these errors were encountered: