the connection pool reuses connections, so when you "close" a connection, often it is recycled so that it is returned to its pooled store rather than being fully closed.
Some background on this is at https://docs.sqlalchemy.org/en/13/glossary.html#term-released On Wed, May 6, 2020, at 8:45 AM, Oğuzhan Kaya wrote: > what is mean that checkedout checkedin connection and why When connection is > closed connection in pool number increases? > > 5 Mayıs 2020 Salı 19:50:22 UTC+3 tarihinde Mike Bayer yazdı: >> engine.pool has some metrics on it: >> >> >>> from sqlalchemy import create_engine >> >>> e = create_engine("mysql://scott:tiger@localhost/test") >> >>> e.pool.status() >> 'Pool size: 5 Connections in pool: 0 Current Overflow: -5 Current Checked >> out connections: 0' >> >>> e.pool.checkedout() >> 0 >> >>> c1 = e.connect() >> >>> e.pool.checkedout() >> 1 >> >>> e.pool.status() >> 'Pool size: 5 Connections in pool: 0 Current Overflow: -4 Current Checked >> out connections: 1' >> >>> c2 = e.connect() >> >>> e.pool.status() >> 'Pool size: 5 Connections in pool: 0 Current Overflow: -3 Current Checked >> out connections: 2' >> >>> c1.close() >> >>> e.pool.status() >> 'Pool size: 5 Connections in pool: 1 Current Overflow: -3 Current Checked >> out connections: 1' >> >>> c2.close() >> >>> e.pool.status() >> 'Pool size: 5 Connections in pool: 2 Current Overflow: -3 Current Checked >> out connections: 0' >> >> >> >> >> On Tue, May 5, 2020, at 11:14 AM, Oğuzhan Kaya wrote: >>> I made a connection with sqlalchemy to mssql and I used queue pool. I am >>> trying to understand this connetion pool is worked or not. and also I want >>> to see the connections and the queue inside connection pool how can I see? >>> >>> engine = sal.create_engine('IP',pool_size=1,max_overflow=0) >>> result = engine.execute('select * from mytable') >>> result.close() >>> >>> -- >>> 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 sqlal...@googlegroups.com. >>> To view this discussion on the web visit >>> https://groups.google.com/d/msgid/sqlalchemy/d565c8a9-0d34-46cb-971a-b08ecc1fc881%40googlegroups.com >>> >>> <https://groups.google.com/d/msgid/sqlalchemy/d565c8a9-0d34-46cb-971a-b08ecc1fc881%40googlegroups.com?utm_medium=email&utm_source=footer>. >> > > -- > 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/78d2ce76-b6f1-4cc5-93d6-96939c4c7728%40googlegroups.com > > <https://groups.google.com/d/msgid/sqlalchemy/78d2ce76-b6f1-4cc5-93d6-96939c4c7728%40googlegroups.com?utm_medium=email&utm_source=footer>. -- 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/da67aab7-b83c-4b6e-aa0c-9378bec1f5c0%40www.fastmail.com.