AntiPattern
Misused Session Context
misused-session-context
A recurring session-management shape where application code stores or returns a session factory/callable instead of an actual context manager, leading to context-protocol failures and incorrect lifecycle handling of database sessions.