we should fix that an add a new method like engine.detach() or something like that which strictly de-associates the engine from the pool of the parent process and makes a new one.
right now the way to do that is: engine.pool = engine.pool.recreate() gives it a brand new pool and just loses references to the old one. On Mon, Apr 2, 2018 at 1:53 PM, Jonathan Vanasco <jvana...@gmail.com> wrote: > > > On Monday, April 2, 2018 at 1:40:06 PM UTC-4, Mike Bayer wrote: >> >> now we can probably do better than that but the dispose() case is not >> supposed to be that common or critical, it's usually for when you just >> did a fork(), and you don't want to reference any of the filehandles >> in the parent process (but to that extent, dispose() is not ideal >> because it will step on those connections that might be *used* by the >> parent....so...more bugs :) ) > > > One person's uncommon is another person's everyday ;) > > Someone was running a pyramid app with SqlAlchemy connection issues. They > were running in a gunicorn container, and connected to the database pre-fork > to pull out some configuration settings - at the very least they needed to > call `Engine.dispose()`. There may be some other things going on too, but > that's the guaranteed way to screw up database connections running in > gunicorn, uwsgi and a few other servers. > > -- > SQLAlchemy - > The Python SQL Toolkit and Object Relational Mapper > > http://www.sqlalchemy.org/ > > To post example code, please provide an MCVE: Minimal, Complete, and > Verifiable Example. See http://stackoverflow.com/help/mcve for a full > description. > --- > You received this message because you are subscribed to the Google Groups > "sqlalchemy" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to sqlalchemy+unsubscr...@googlegroups.com. > To post to this group, send email to sqlalchemy@googlegroups.com. > Visit this group at https://groups.google.com/group/sqlalchemy. > For more options, visit https://groups.google.com/d/optout. -- SQLAlchemy - The Python SQL Toolkit and Object Relational Mapper http://www.sqlalchemy.org/ To post example code, please provide an MCVE: Minimal, Complete, and Verifiable Example. See http://stackoverflow.com/help/mcve for a full description. --- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this group and stop receiving emails from it, send an email to sqlalchemy+unsubscr...@googlegroups.com. To post to this group, send email to sqlalchemy@googlegroups.com. Visit this group at https://groups.google.com/group/sqlalchemy. For more options, visit https://groups.google.com/d/optout.