Solves the data race when trying to create a session.
As I understand it, if another transaction deletes an exercise during an insertion transaction, the transaction will fail based on the foreign key constraints. The verification if the exercises are available for the author is now done inside the transaction, thus we can interrupt the transaction if the exercises does not belong to the user inside the given transaction.
Resolved Issue
Fixes #71
Changes
Remove a function from exercise repo and add a new to session repo and change the function in session service
Description
Solves the data race when trying to create a session. As I understand it, if another transaction deletes an exercise during an insertion transaction, the transaction will fail based on the foreign key constraints. The verification if the exercises are available for the author is now done inside the transaction, thus we can interrupt the transaction if the exercises does not belong to the user inside the given transaction.
Resolved Issue
Fixes #71
Changes
Remove a function from exercise repo and add a new to session repo and change the function in session service