gino-starlette icon indicating copy to clipboard operation
gino-starlette copied to clipboard

DB connection for request is not released when there are more than one database

Open kigawas opened this issue 5 years ago • 1 comments

With use_connection_for_request=True and two DBs:

db1.init_app(app)
db2.init_app(app)

And in the fastapi router, query db1 and db2.

  1. Call the api
  2. Change file contents to make it reload
  3. Try exiting

Then you'll see the server gets stuck.

kigawas avatar Sep 09 '20 09:09 kigawas

I guess the problem is in _Middleware, when setting scope, one connection overrides another.

kigawas avatar Sep 09 '20 09:09 kigawas