Commit 8663eb1d by Ashutosh Mestry Committed by Madhan Neethiraj

ATLAS-2195: fix to close trasaction left open while queries index keys (#2)

parent 59f83fc0
...@@ -261,9 +261,6 @@ public class GraphBackedSearchIndexer implements SearchIndexer, ActiveStateChang ...@@ -261,9 +261,6 @@ public class GraphBackedSearchIndexer implements SearchIndexer, ActiveStateChang
try { try {
management = provider.get().getManagementSystem(); management = provider.get().getManagementSystem();
} catch (RepositoryException excp) {
LOG.error("failed to get indexedKeys from graph", excp);
}
if (management != null) { if (management != null) {
AtlasGraphIndex vertexIndex = management.getGraphIndex(Constants.VERTEX_INDEX); AtlasGraphIndex vertexIndex = management.getGraphIndex(Constants.VERTEX_INDEX);
...@@ -279,6 +276,19 @@ public class GraphBackedSearchIndexer implements SearchIndexer, ActiveStateChang ...@@ -279,6 +276,19 @@ public class GraphBackedSearchIndexer implements SearchIndexer, ActiveStateChang
vertexIndexKeys = indexKeys; vertexIndexKeys = indexKeys;
} }
management.commit();
}
} catch (Exception excp) {
LOG.error("getVertexIndexKeys(): failed to get indexedKeys from graph", excp);
if (management != null) {
try {
management.rollback();
} catch (Exception e) {
LOG.error("getVertexIndexKeys(): rollback failed", e);
}
}
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment