]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Improved the behavior of instance management regarding
authorMike Bayer <mike_mp@zzzcomputing.com>
Sat, 20 Apr 2013 06:45:08 +0000 (02:45 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sat, 20 Apr 2013 06:45:08 +0000 (02:45 -0400)
commit6c1972e4ecd7f2d738aa1578bc95d4a77820278d
treeb65f3b060672c1adda23a0bacaff41e6b5f626e0
parent15b3d2f5bd3ff24b06945a3243eef0d3f523db15
Improved the behavior of instance management regarding
the creation of strong references within the Session;
an object will no longer have an internal reference cycle
created if it's in the transient state or moves into the
detached state - the strong ref is created only when the
object is attached to a Session and is removed when the
object is detached.  This makes it somewhat safer for an
object to have a `__del__()` method, even though this is
not recommended, as relationships with backrefs produce
cycles too.  A warning has been added when a class with
a `__del__()` method is mapped.
[ticket:2708]
doc/build/changelog/changelog_08.rst
lib/sqlalchemy/orm/instrumentation.py
lib/sqlalchemy/orm/mapper.py
lib/sqlalchemy/orm/session.py
lib/sqlalchemy/orm/state.py
test/orm/test_instrumentation.py
test/orm/test_session.py