Hi,
I see in the
documentation that we can bind a connection to a SQLAlchemy session object:
# at the module level, the global sessionmaker,
# bound to a specific Engine
Session = sessionmaker(bind=engine)
# later, some unit of code wants to create a
# Session that is bound to a specific Connection
conn = engine.connect()
session = Session(bind=conn)
How do we release the connection to an external connection pool safely? For instance, if we are using a
cx_Oracle SessionPool to acquire and release connections?
session.close() is not doing that seamlessly in this case.
if we do, session = Session(bind=engine) - it usually releases connection to the pool seamlessly on session.close().
Thanks,
Anupama