SQLAlchemy sessions poorly implemented #5

Closed
opened 2021-06-01 08:51:05 +01:00 by kae · 0 comments
Owner

Currently, one session is started when application starts, and is used forever. If MySQL goes away or the session times out, the app will fail.

The correct way of using sessions is to create a session for a group of related database tasks, and close it once those tasks are complete.

Currently, one session is started when application starts, and is used forever. If MySQL goes away or the session times out, the app will fail. The [correct way of using sessions](https://docs.sqlalchemy.org/en/14/orm/session_basics.html#when-do-i-construct-a-session-when-do-i-commit-it-and-when-do-i-close-it) is to create a session for a group of related database tasks, and close it once those tasks are complete.
kae closed this issue 2021-06-02 08:28:24 +01:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: kae/musicmuster#5
No description provided.