Hi,

I see in the documentation 
<https://docs.sqlalchemy.org/en/13/orm/session_basics.html> 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 
<https://cx-oracle.readthedocs.io/en/latest/api_manual/session_pool.html> 
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


-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sqlalchemy/66a43491-e94b-4b9c-a2ff-6e4ec8ee2cccn%40googlegroups.com.

Reply via email to