]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Added an option to permanently close sessions.
authorDaniel Krzeminski <dankrzeminski32@gmail.com>
Tue, 22 Aug 2023 18:18:48 +0000 (14:18 -0400)
committerFederico Caselli <cfederico87@gmail.com>
Mon, 2 Oct 2023 20:52:26 +0000 (22:52 +0200)
commit8c72495e4dbd0e39968d0b99dcdede24f68fd9d1
tree63a7d4fa7afa520d799b7a80c65812f103c27c01
parentf96da1a8985dfb9303eef41135044c82420d08cc
Added an option to permanently close sessions.

Set to ``False`` the new parameter :paramref:`_orm.Session.close_is_reset`
will prevent a :class:`_orm.Session` from performing any other
operation after :meth:`_orm.Session.close` has been called.

Added new method :meth:`_orm.Session.reset` that will reset a :class:`_orm.Session`
to its initial state. This is an alias of :meth:`_orm.Session.close`,
unless :paramref:`_orm.Session.close_is_reset` is set to ``False``.

Fixes: #7787
Closes: #10137
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/10137
Pull-request-sha: 881241e19b24f34e4553b2d58070bfa99597f4e4

Change-Id: Ic3512874600daff4ed66bb0cd29a3a88f667d258
doc/build/changelog/unreleased_20/7787.rst [new file with mode: 0644]
doc/build/orm/session_basics.rst
lib/sqlalchemy/ext/asyncio/scoping.py
lib/sqlalchemy/ext/asyncio/session.py
lib/sqlalchemy/orm/scoping.py
lib/sqlalchemy/orm/session.py
test/ext/asyncio/test_session_py3k.py
test/orm/test_session.py