add "permanent=True" flag to session.close()

Issue #2706 resolved
Mike Bayer repo owner created an issue

I think the idea of Session.close() allowing the session to spring back to life again causes more problems than it solves, e.g. http://stackoverflow.com/questions/15881439/sqlalchemy-not-closing-sessions-with-orm/15938093. If we add a flag "permanent=True" and document that, users can have a "close this session and please don't allow my code to use it again" behavior, since I think that's probably what people would prefer (i.e. close() should have been this way all the time, too late for that though).

Comments (5)

  1. Log in to comment