[sqlalchemy] Using metadata built from parent process's engine

2019-07-10 Thread Zach
Our application uses gunicorn and we are looking to enable preload_app. In preparation, we moved the creation of the sqlalchemy engine into a post-fork hook for each gunicorn worker, ensuring that DB connections are created separately within each process. Unfortunately our sqlalchemy declarat

[sqlalchemy] Rolling back transactions across flushes?

2016-10-27 Thread Zach
Hi, I'd really appreciate some assistance with the below issue. Rolling back sqlalchemy transactions cross-flush currently appears impossible to me. It’s necessary if you want to issue queries that rely on the presence of an assigned primary key identifier (adding something to the session is

[sqlalchemy] SQLAlchemy/Python: Using an engine per process, and injecting that engine into dependencies

2014-08-17 Thread Zach
SQLAlchemy recommends using one engine per process because the underlying DBAPI connections are not necessarily safe to use across processes. I have global engine and session variables that gets lazily populated with a SQLAlchemy engine and a session factory, respectively. This makes it easy

[sqlalchemy] SQLAlchemy/Python: Using an engine per process, and injecting that engine into dependencies

2014-08-17 Thread Zach
SQLAlchemy recommends using one engine per process because the underlying DBAPI connections are not necessarily safe to use across processes. I have global engine and session variables that gets lazily populated with a SQLAlchemy engine and a session factory, respectively. This makes it easy