hutschen / mv-tool-api

Measure tracking tool for the implementation of information security measures in projects
https://mv-tool.readthedocs.io
GNU Affero General Public License v3.0
2 stars 0 forks source link

Execute database commits at the end of endpoint handlers #146

Open hutschen opened 1 year ago

hutschen commented 1 year ago

Commits to the database must occur at the end of the endpoint handler functions. This is the only way to ensure that the changes made by an API request in the database have actually been committed to the database.

In addition, race conditions are avoided in this way. These can occur if several API calls that refer to each other take place one after the other. For example, an API call may create objects in the database that a subsequent API call that is supposed to retrieve these objects does not return because the commit of the previous API call has not yet taken place.

The following should be implemented: