diff options
Diffstat (limited to 'catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ComponentBusinessLogic.java')
-rw-r--r-- | catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ComponentBusinessLogic.java | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ComponentBusinessLogic.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ComponentBusinessLogic.java index d0d40e9db0..6007d0602e 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ComponentBusinessLogic.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ComponentBusinessLogic.java @@ -426,11 +426,13 @@ public abstract class ComponentBusinessLogic extends BaseBusinessLogic { public Either<List<Component>, ResponseFormat> getLatestVersionNotAbstractComponentsMetadata(boolean isAbstractAbstract, HighestFilterEnum highestFilter, ComponentTypeEnum componentTypeEnum, - String internalComponentType, String userId) { + String internalComponentType, String userId, + String modelName) { + Either<List<Component>, StorageOperationStatus> nonCheckoutCompResponse = null; try { validateUserExists(userId); - Either<List<Component>, StorageOperationStatus> nonCheckoutCompResponse = toscaOperationFacade - .getLatestVersionNotAbstractMetadataOnly(isAbstractAbstract, componentTypeEnum, internalComponentType); + nonCheckoutCompResponse = toscaOperationFacade + .getLatestVersionNotAbstractMetadataOnly(isAbstractAbstract, componentTypeEnum, internalComponentType, modelName); if (nonCheckoutCompResponse.isLeft()) { log.debug("Retrieved Resource successfully."); return Either.left(nonCheckoutCompResponse.left().value()); @@ -438,7 +440,9 @@ public abstract class ComponentBusinessLogic extends BaseBusinessLogic { return Either .right(componentsUtils.getResponseFormat(componentsUtils.convertFromStorageResponse(nonCheckoutCompResponse.right().value()))); } finally { - janusGraphDao.commit(); + if(nonCheckoutCompResponse != null && nonCheckoutCompResponse.isLeft() ) { + janusGraphDao.commit(); + } } } |