]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
- A rare case which occurs when a :meth:`.Session.rollback` fails in the
authorMike Bayer <mike_mp@zzzcomputing.com>
Thu, 19 Nov 2015 20:45:17 +0000 (15:45 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Thu, 19 Nov 2015 20:45:47 +0000 (15:45 -0500)
commitcaef13d8cf0193d44bf99dc8f617574d71630d97
tree7e9ccc21eb9a88db630bab2fb9878ce4e9af45e9
parent423697dea60cac0daea05c30ed8fd24cc3571479
- A rare case which occurs when a :meth:`.Session.rollback` fails in the
scope of a :meth:`.Session.flush` operation that's raising an
exception, as has been observed in some MySQL SAVEPOINT cases, prevents
the original  database exception from being observed when it was
emitted during  flush, but only on Py2K because Py2K does not support
exception  chaining; on Py3K the originating exception is chained.  As
a workaround, a warning is emitted in this specific case showing at
least the string message of the original database error before we
proceed to raise  the rollback-originating exception.
fixes #2696

(cherry picked from commit a6fe4dc0c8ebc346a90dd849a86dac9345d74515)
doc/build/changelog/changelog_10.rst
lib/sqlalchemy/orm/session.py
lib/sqlalchemy/testing/assertions.py
test/orm/test_transaction.py