Skip to content

Reorganize database transactions - Prevent data inconsistency  #46

@V3lop5

Description

@V3lop5

Describe the solution you'd like
Currently a database session is handed over to crud operations. Inside a crud operation one or two commits are made.
This may result in data inconsistency.

Example:
Calling crud.energy_source.create will call crud.energy_component.create and completes one transaction (commit) inside. Another transaction is handled inside crud.energy_source.create. If second transaction fails the first one is still executed.

In order to resolve this, every endpoint request should be handled as one transaction. All crud operations inside get rolled back, if one error occurs.

Additional context
Nothing for now

Metadata

Metadata

Assignees

No one assigned

    Labels

    code qualityWould improve code qualityenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions