Removed deprecated use of FramedGraph
diff --git a/src/main/java/net/onrc/onos/graph/GraphDBConnection.java b/src/main/java/net/onrc/onos/graph/GraphDBConnection.java
index 16869c5..9682d51 100644
--- a/src/main/java/net/onrc/onos/graph/GraphDBConnection.java
+++ b/src/main/java/net/onrc/onos/graph/GraphDBConnection.java
@@ -11,6 +11,7 @@
import com.tinkerpop.blueprints.Vertex;
import com.tinkerpop.blueprints.util.wrappers.event.EventTransactionalGraph;
import com.tinkerpop.frames.FramedGraph;
+import com.tinkerpop.frames.FramedGraphFactory;
public class GraphDBConnection implements IDBConnection {
public enum Transaction {
@@ -33,6 +34,7 @@
.getLogger(GraphDBConnection.class);
private static GraphDBConnection singleton = new GraphDBConnection();
private static TitanGraph graph;
+ private static FramedGraphFactory factory;
private static FramedGraph<TitanGraph> fg;
private static EventTransactionalGraph<TitanGraph> eg;
private static String configFile;
@@ -86,7 +88,9 @@
graph.createKeyIndex("ipv4_address", Vertex.class);
}
graph.commit();
- fg = new FramedGraph<TitanGraph>(graph);
+ // Make sure you reuse the factory when creating new framed graphs
+ factory = new FramedGraphFactory();
+ fg = factory.create(graph);
eg = new EventTransactionalGraph<TitanGraph>(graph);
}
return singleton;
@@ -97,7 +101,12 @@
*/
@Override
public FramedGraph<TitanGraph> getFramedGraph() {
- return fg;
+ if (isValid()) {
+ return fg;
+ } else {
+ log.error("New FramedGraph failed");
+ return null;
+ }
}
/**