Fix (again) missing parent dependency #367
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The Internal Server Error "Missing Dependency with id XYZ" is still occurring as PR #355 didn't solve the problem entirely (it mainly prevents the multiplication of dependencies).
The error occurs when several scans of the same application are run in parallel. It can be reproduced triggering several time the HTTP requests corresponding to the goals CLEAN and APP. In particular, it consistently occur when running 7 times the pair of calls to clean (POST) and save the app (PUT).
The "missing dependency" issue occurs at the end of the parallel calls, whereas during their execution we get different exceptions: constraint violation on app_constricts_pk (when saving the same application in parallel) and optimisticLocking exception (when saving entities that were updated or deleted in parallel).
Solution:
We add the transactional annotation to the customSave method of ApplicationRepositoryImpl.class so that changes are rolledback if something goes wrong.