Fix REST data being out of date and causing fluctuating flows, links and switches
diff --git a/src/main/java/net/floodlightcontroller/core/internal/TopoSwitchServiceImpl.java b/src/main/java/net/floodlightcontroller/core/internal/TopoSwitchServiceImpl.java
index 931802e..502fad6 100644
--- a/src/main/java/net/floodlightcontroller/core/internal/TopoSwitchServiceImpl.java
+++ b/src/main/java/net/floodlightcontroller/core/internal/TopoSwitchServiceImpl.java
@@ -29,6 +29,7 @@
 	public Iterable<ISwitchObject> getActiveSwitches() {
 		// TODO Auto-generated method stub
 		conn = GraphDBConnection.getInstance("/tmp/cassandra.titan");
+		conn.close(); //Commit to ensure we see latest data
 		return conn.utils().getActiveSwitches(conn);
 	}
 
@@ -36,6 +37,7 @@
 	public Iterable<ISwitchObject> getAllSwitches() {
 		// TODO Auto-generated method stub
 		conn = GraphDBConnection.getInstance("/tmp/cassandra.titan");
+		conn.close(); //Commit to ensure we see latest data
 		return conn.utils().getAllSwitches(conn);
 	}
 
@@ -43,6 +45,7 @@
 	public Iterable<ISwitchObject> getInactiveSwitches() {
 		// TODO Auto-generated method stub
 		conn = GraphDBConnection.getInstance("/tmp/cassandra.titan");
+		conn.close(); //Commit to ensure we see latest data
 		return conn.utils().getInactiveSwitches(conn);
 	}