aboutsummaryrefslogtreecommitdiffstats
path: root/aai-core
diff options
context:
space:
mode:
authorVenkata Harish K Kajur <vk250x@att.com>2017-09-06 15:35:08 -0400
committerVenkata Harish K Kajur <vk250x@att.com>2017-09-06 15:35:17 -0400
commit809c34654199341b7a4119123d1909337cc43a7a (patch)
treea7603c4322b89cad89a99408fc1057e47dd57160 /aai-core
parent399b9ed2f91c99107e0f357719452cacca3a2ad5 (diff)
Fix the AAIGraph closing prematurely that was
accidentally introduced during sonar change Issue-ID: AAI-237 Change-Id: Ibd806042c09073bf7f4f24b6f842aa863af0a617 Signed-off-by: Venkata Harish K Kajur <vk250x@att.com>
Diffstat (limited to 'aai-core')
-rw-r--r--aai-core/src/main/java/org/openecomp/aai/dbmap/AAIGraph.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/aai-core/src/main/java/org/openecomp/aai/dbmap/AAIGraph.java b/aai-core/src/main/java/org/openecomp/aai/dbmap/AAIGraph.java
index 2ee8baf5..4921b91d 100644
--- a/aai-core/src/main/java/org/openecomp/aai/dbmap/AAIGraph.java
+++ b/aai-core/src/main/java/org/openecomp/aai/dbmap/AAIGraph.java
@@ -96,8 +96,10 @@ public class AAIGraph {
}
private void loadGraph(String name, String configPath) throws AAIException {
- try (TitanGraph graph = TitanFactory.open(configPath);
- InputStream is = new FileInputStream(configPath)) {
+ // Graph being opened by TitanFactory is being placed in hashmap to be used later
+ // These graphs shouldn't be closed until the application shutdown
+ TitanGraph graph = TitanFactory.open(configPath);
+ try (InputStream is = new FileInputStream(configPath)) {
Properties graphProps = new Properties();
graphProps.load(is);
@@ -117,7 +119,6 @@ public class AAIGraph {
throw new AAIException("AAI_4001");
} catch (IOException e) {
throw new AAIException("AAI_4002");
-
}
}