summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/orm/dynamic.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2021-05-02 10:19:16 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2021-05-02 10:19:16 -0400
commitee7a82d71783bf71f3a95550624740e908d178a0 (patch)
tree67a7af7e21ed8f1df7a1830e354058bf42b54929 /lib/sqlalchemy/orm/dynamic.py
parentbae435d44863e9c364dd9df8482c014ad7d56ee4 (diff)
downloadsqlalchemy-ee7a82d71783bf71f3a95550624740e908d178a0.tar.gz
restore legacy begin_nested()->root transaction behavior
Restored a legacy transactional behavior that was inadvertently removed from the :class:`_engine.Connection` as it was never tested as a known use case in previous versions, where calling upon the :meth:`_engine.Connection.begin_nested` method, when no transaction were present, would not create a SAVEPOINT at all, and would instead only start the outermost transaction alone, and return that :class:`.RootTransaction` object, acting like the outermost transaction. Committing the transaction object returned by :meth:`_engine.Connection.begin_nested` would therefore emit a real COMMIT on the database connection. This behavior is not at all what the 2.0 style connection will do - in 2.0 style, calling :meth:`_future.Connection.begin_nested` will "autobegin" the outer transaction, and then as instructed emit a SAVEPOINT, returning the :class:`.NestedTransaction` object. The outer transaction is committed by calling upon :meth:`_future.Connection.commit`, as is "commit-as-you-go" style usage. In non-"future" mode, while the old behavior is restored, it also emits a 2.0 deprecation warning as this is a legacy behavior. Additionally clarifies and reformats various engine-related documentation, in particular future connection.begin() which was a tire fire. Fixes: #6408 Change-Id: I4b81cc6b481b5493eef4c91bebc03210e2206d39
Diffstat (limited to 'lib/sqlalchemy/orm/dynamic.py')
0 files changed, 0 insertions, 0 deletions