views:

51

answers:

1

I am using sqlalchemy with Mysql, and executing query with sql expression . when executing a number of query then it time out. I found an answer but it is not clear to me -- Answer link . plz any one can help me?

TimeoutError: QueuePool limit of size 5 overflow 10 reached, connection timed out, timeout 30

+2  A: 

Whenever you create a new session in your code, make sure you close it. Just call session.close()

When I got this error I thought I was closing all of my sessions, but I looked carefully and there was one new method where I wasn't. Closing the session in that method fixed this error for me.

Greg