We're updating the issue view to help you get more done. 

Bind the DB session lifetime to the HTTP request

Description

wazo-auth currently manages its DB connection manually in the queries package. Each call to a function in the queries module will create a new session and commit or rollback.

This flow has many disadvantages.
1. the sqlalchemy object must be serialized to return there value from the function
2. It prevents the objects from being serialized only once using the marshmallow schema in the http module
3. The Session cannot be rolledback if an error happens after que call to the query function has completed.

Environment

None

Assignee

Pascal Cadotte

Reporter

Pascal Cadotte

Labels

Approvers

François Blackburn

Pair

François Blackburn

Sprint

None

Fix versions

Priority

Medium
Configure