aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKajur, Harish (vk250x) <vk250x@att.com>2019-04-15 12:16:43 -0400
committerKajur, Harish (vk250x) <vk250x@att.com>2019-04-15 13:00:01 -0400
commit5dc2f95ceb355d2e6db4ee35ec14fdfd86a1cb3d (patch)
treedc14dd4dfa0f6cb5e3dd8698267eacbcad8827c9
parentb801c94af4023b7cc744d1749f202d2e0df62b94 (diff)
Fix GenTester by moving the commit earlier
so if an exception is thrown during commit it gets caught properly and is handled Issue-ID: AAI-2377 Change-Id: I529edcabad4afe803ff387c1a186d9daba44ddc7 Signed-off-by: Kajur, Harish (vk250x) <vk250x@att.com>
-rw-r--r--src/main/java/org/onap/aai/schema/GenTester.java24
1 files changed, 13 insertions, 11 deletions
diff --git a/src/main/java/org/onap/aai/schema/GenTester.java b/src/main/java/org/onap/aai/schema/GenTester.java
index ebc0aba..04ade0a 100644
--- a/src/main/java/org/onap/aai/schema/GenTester.java
+++ b/src/main/java/org/onap/aai/schema/GenTester.java
@@ -154,23 +154,25 @@ public class GenTester {
System.out.println(imsg);
LOGGER.info(imsg);
SchemaGenerator.loadSchemaIntoJanusGraph(graph, graphMgt, null);
+
+ if( graph != null ){
+ imsg = "-- graph commit";
+ System.out.println(imsg);
+ LOGGER.info(imsg);
+ graph.tx().commit();
+
+ imsg = "-- graph shutdown ";
+ System.out.println(imsg);
+ LOGGER.info(imsg);
+ graph.close();
+ }
+
} catch(Exception ex) {
ErrorLogHelper.logError("AAI_4000", ex.getMessage());
System.exit(1);
}
- if( graph != null ){
- String imsg = "-- graph commit";
- System.out.println(imsg);
- LOGGER.info(imsg);
- graph.tx().commit();
-
- imsg = "-- graph shutdown ";
- System.out.println(imsg);
- LOGGER.info(imsg);
- graph.close();
- }
LOGGER.auditEvent("-- all done, if program does not exit, please kill.");
System.exit(0);