Skip to content

Flask-Admin w/ SQLAlchemy holds a single session for the entire app lifetime? #2675

@samuelhwilliams

Description

@samuelhwilliams

Passing db.session to the admin model views will create a session and then hold that for the lifetime of the app. This feels wrong - it should probably be using request-scoped sessions each time?

TBD further investigation to narrow down if this is a generic sqlalchemy flask-admin issue, or flask-sqlalchemy vs flask-sqlalchemy-lite.

Also to add a reproduction case.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions