Re: [sqlalchemy] None! Can't pickle : it's not the same object as sqlalchemy.orm.session.Session

2022-03-16 Thread Mike Bayer
can confirm, don't try passing Session objects as arguments over multiprocessing. that's not going to work for many reasons. new child process should use its own session. On Wed, Mar 16, 2022, at 6:42 AM, Simon King wrote: > I haven't used the multiprocessing library, but if it uses pickle

Re: [sqlalchemy] None! Can't pickle : it's not the same object as sqlalchemy.orm.session.Session

2022-03-16 Thread Simon King
I haven't used the multiprocessing library, but if it uses pickle to transfer SQLAlchemy objects, it's going to be difficult to make it work. Objects loaded via the SQLAlchemy ORM hold a references to the Session that was used to load them, which in turn holds a reference to a database connection.