Merge pull request #1015 from jschneid-nmdp/resolve-term-upload-deferred-short-circuit

avoid potential short circuit during saveDeferred processing of uploaded (e.g. LOINC) terminology
This commit is contained in:
James Agnew 2018-06-27 10:33:06 -04:00 committed by GitHub
commit 8c849b16a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 5 deletions

View File

@ -850,15 +850,16 @@ public abstract class BaseHapiTerminologySvcImpl implements IHapiTerminologySvc,
return; return;
} else if (myDeferredConcepts.isEmpty() && myConceptLinksToSaveLater.isEmpty()) { } else if (myDeferredConcepts.isEmpty() && myConceptLinksToSaveLater.isEmpty()) {
processReindexing(); processReindexing();
return;
} }
TransactionTemplate tt = new TransactionTemplate(myTransactionMgr); TransactionTemplate tt = new TransactionTemplate(myTransactionMgr);
tt.setPropagationBehavior(TransactionTemplate.PROPAGATION_REQUIRES_NEW); tt.setPropagationBehavior(TransactionTemplate.PROPAGATION_REQUIRES_NEW);
tt.execute(t -> { if(!myDeferredConcepts.isEmpty() || !myConceptLinksToSaveLater.isEmpty()) {
processDeferredConcepts(); tt.execute(t -> {
return null; processDeferredConcepts();
}); return null;
});
}
if (myDeferredValueSets.size() > 0) { if (myDeferredValueSets.size() > 0) {
tt.execute(t -> { tt.execute(t -> {