Re: [sqlalchemy] dispose/close question

2018-04-03 Thread Jonathan Vanasco
On Tuesday, April 3, 2018 at 11:41:43 AM UTC-4, Mike Bayer wrote: > > right, the dispose() will emit "close connection" commands on the > socket which will leak into the parent process. > But only if `close()` has been called -- right? > they're not ! :) that's one of the "features" of

Re: [sqlalchemy] dispose/close question

2018-04-03 Thread Mike Bayer
On Mon, Apr 2, 2018 at 10:19 PM, Jonathan Vanasco wrote: > looking at the current `engine.dispose()` (which I should have done sooner), > that's pretty much what it's doing -- right? > >

Re: [sqlalchemy] dispose/close question

2018-04-02 Thread Jonathan Vanasco
looking at the current `engine.dispose()` (which I should have done sooner), that's pretty much what it's doing -- right? https://bitbucket.org/zzzeek/sqlalchemy/src/55371f4cffa730f65f1b687e9f6287d2ac189227/lib/sqlalchemy/engine/base.py?at=master=file-view-default#base.py-1899:1923

Re: [sqlalchemy] dispose/close question

2018-04-02 Thread Mike Bayer
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

Re: [sqlalchemy] dispose/close question

2018-04-02 Thread Jonathan Vanasco
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

Re: [sqlalchemy] dispose/close question

2018-04-02 Thread Mike Bayer
On Mon, Apr 2, 2018 at 1:36 PM, Jonathan Vanasco wrote: > clarifying: I had run tests, and the checked-out connections are still open > after dispose(), and then garbage collected out. > now we can probably do better than that but the dispose() case is not supposed to be that

Re: [sqlalchemy] dispose/close question

2018-04-02 Thread Jonathan Vanasco
clarifying: I had run tests, and the checked-out connections are still open after dispose(), and then garbage collected out. -- SQLAlchemy - The Python SQL Toolkit and Object Relational Mapper http://www.sqlalchemy.org/ To post example code, please provide an MCVE: Minimal, Complete, and

Re: [sqlalchemy] dispose/close question

2018-04-02 Thread Jonathan Vanasco
On Monday, April 2, 2018 at 1:21:26 PM UTC-4, Mike Bayer wrote: > > Connections that are checked out stay open, they > still refer to that dereferenced pool, and I think at the moment they > don't get closed until they are garbage collected along with that pool > object. > Thanks. That's

Re: [sqlalchemy] dispose/close question

2018-04-02 Thread Mike Bayer
On Mon, Apr 2, 2018 at 1:10 PM, Jonathan Vanasco wrote: > a question came up in another list, and I just wanted to confirm a behavior > > it looks like `engine.dispose()` doesn't explicitly `close()` any open > connections, but they inherently get closed by the method's

[sqlalchemy] dispose/close question

2018-04-02 Thread Jonathan Vanasco
a question came up in another list, and I just wanted to confirm a behavior it looks like `engine.dispose()` doesn't explicitly `close()` any open connections, but they inherently get closed by the method's behavior. is that right? -- SQLAlchemy - The Python SQL Toolkit and Object Relational