warn when mapped object has __del__

Issue #2708 resolved
Mike Bayer repo owner created an issue

the "instancestate->strong_obj" link, which is created regardless of a session being present, creates a cycle. therefore __del__ is guaranteed in many cases to render the object unreachable. even if we added lots of games to minimize the strong_obj cycle, it still can be present in the case where the session is discarded while pending/dirty objects are present. therefore a warning should be emitted when mapper() is applied to any class that has a __del__() method.

Comments (3)

  1. Mike Bayer reporter

    additionally, we should look into removing the strong_obj link when objects are expunged from a session; we may also want hold off on creating the link when the object doesn't have a session_id,turning it on in attachment when modified=True. these should be easy conditions to write tests for.

  2. Log in to comment