connetion are not disconntected when set pool_size=0 (documentation)

Issue #1164 resolved
Former user created an issue

version tested: SQLAlchemy 0.5.0rc1

I use engine like this, I set pool_size=0,

engine = create_engine('mysql://root:password@localhost/test', pool_size=0, max_overflow=2, echo=True)

I like the behavior will be: establish a connection with mysql when I need it and release all connections when I close all sessions. I don't need the pool to keep "sleeping" connetions.

but it sames that all the two connections don't release at all.

If I set pool_size >= 1, the pool works correctly.

Is it a bug or not?

Thanks!

Comments (6)

  1. Mike Bayer repo owner

    thats not a QueuePool use case. use the NullPool which doesn't do any pooling (just opens and closes connections).

  2. Former user Account Deleted
    • removed status
    • changed status to open

    I think the special meaning of pool_size=0 is a deficiency of the documentation; patch attached.

  3. Log in to comment