diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2020-05-13 12:42:08 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2020-05-13 16:12:42 -0400 |
commit | 916e1fea25afcd07fa1d1d2f72043b372cd02223 (patch) | |
tree | d34e5e16b2a0679499d2cbd40a6ef23f56d9ec4c /lib/sqlalchemy/testing/assertions.py | |
parent | ce6619756e9f142394aa01e3ea70c9db781537e4 (diff) | |
download | sqlalchemy-916e1fea25afcd07fa1d1d2f72043b372cd02223.tar.gz |
Assert reset agent always set correctly and is active
Fixed fairly critical issue where the DBAPI connection could be returned to
the connection pool while still in an un-rolled-back state. The reset agent
responsible for rolling back the connection could be corrupted in the case
that the transaction was "closed" without being rolled back or committed,
which can occur in some scenarios when using ORM sessions and emitting
.close() in a certain pattern involving savepoints. The fix ensures that
the reset agent is always active.
note that the reset agent will go away in 2.0 and the only real
purpose of it is for logging of ROLLBACK. Apparently with the
SQLite singleton engine in the test suite, there are some strucutral
mismatches in the test fixtures where the reset agent is getting
set differently than the transaction likely due to the same connection
being shared in multiple context, though it's unclear.
Fixes: #5326
Change-Id: If056870ea70a2d9a1749768988d5e023f3061b31
Diffstat (limited to 'lib/sqlalchemy/testing/assertions.py')
0 files changed, 0 insertions, 0 deletions