Re: [sqlalchemy] Re: Commands out of sync; you can't run this command now

2019-04-10 Thread Mike Bayer
On Wed, Apr 10, 2019 at 5:15 PM Jonathan Vanasco wrote: > > > > On Wednesday, April 10, 2019 at 3:29:47 PM UTC-4, Mike Bayer wrote: >> >> The connection pool is safe in single process multiple threads. It breaks >> on fork() because the socket travels across the process boundary and is >>

Re: [sqlalchemy] Re: Commands out of sync; you can't run this command now

2019-04-10 Thread Jonathan Vanasco
On Wednesday, April 10, 2019 at 3:29:47 PM UTC-4, Mike Bayer wrote: > > The connection pool is safe in single process multiple threads. It breaks > on fork() because the socket travels across the process boundary and is > essentially copied between two or more processes that are unaware of

Re: [sqlalchemy] Re: Commands out of sync; you can't run this command now

2019-04-10 Thread Mike Bayer
The connection pool is safe in single process multiple threads. It breaks on fork() because the socket travels across the process boundary and is essentially copied between two or more processes that are unaware of each other. On Wed, Apr 10, 2019, 2:55 PM Jonathan Vanasco wrote: > > > On

Re: [sqlalchemy] Re: Commands out of sync; you can't run this command now

2019-04-10 Thread Jonathan Vanasco
On Wednesday, April 10, 2019 at 1:17:01 PM UTC-4, Mike Bayer wrote: > > op, you're right, that is a thing.Not sure if mod_wsgi makes it > easy to make that mistake though, that is, I thought all the Python > happens after the fork. Well, if they are using daemon mode which > you

Re: [sqlalchemy] Re: Commands out of sync; you can't run this command now

2019-04-10 Thread Mike Bayer
On Wed, Apr 10, 2019 at 1:06 PM Jonathan Vanasco wrote: > > > > On Wednesday, April 10, 2019 at 9:23:02 AM UTC-4, tonthon wrote: >> >> Our services are served through apache and mod_wsgi (1 process, 10 threads). >> >> ... > > >> >> I can't reproduce this problem that seems to happen randomly. > >

[sqlalchemy] Re: Commands out of sync; you can't run this command now

2019-04-10 Thread Jonathan Vanasco
On Wednesday, April 10, 2019 at 9:23:02 AM UTC-4, tonthon wrote: > > Our services are served through apache and mod_wsgi (1 process, 10 > threads). > > ... > > I can't reproduce this problem that seems to happen randomly. > > Considering this is multi-process/thread system - does any of your

Re: [sqlalchemy] Commands out of sync; you can't run this command now

2019-04-10 Thread Mike Bayer
On Wed, Apr 10, 2019 at 9:23 AM tonthon wrote: > > Hi, > > We're using sqlalchemy in a Pyramid Web Application. > > We use the ZopeTransactionExtension and our session factory is initialized > this way : > > >>> DBSession = > >>>

[sqlalchemy] Commands out of sync; you can't run this command now

2019-04-10 Thread tonthon
Hi, We're using sqlalchemy in a Pyramid Web Application. We use the ZopeTransactionExtension and our session factory is initialized this way : >>> DBSession = scoped_session(sessionmaker(extension=ZopeTransactionExtension())) We use the pyramid_tm that wraps each web requests in a

Re: [sqlalchemy] sqlite session

2019-04-10 Thread Simon King
On Wed, Apr 10, 2019 at 6:03 AM Mohsen Pahlevanzadeh wrote: > > I have a code for mysql.(by sqlalchemy), Now I converted my data to sqlite3 > for some reasons.Do i have to use session for sqlite? I already write the > following class for support mysql : > >