protected void flushDB() {
		if (graphDb == null)
			return;

		Transaction t = graphDb.beginTx();

		try {
			GlobalGraphOperations op = GlobalGraphOperations.at(graphDb);

			for (Node n : op.getAllNodes()) {
				String nodeId = getNodeId(n);
				sendNodeAdded(sourceId, nodeId);

				for (String key : n.getPropertyKeys())
					if (!key.equals("id"))
						sendNodeAttributeAdded(sourceId, nodeId, key,
								n.getProperty(key));
			}

			for (Relationship e : op.getAllRelationships()) {
				String edgeId = getEdgeId(e);
				String src = getNodeId(e.getStartNode());
				String trg = getNodeId(e.getEndNode());

				sendEdgeAdded(sourceId, edgeId, src, trg, false);

				for (String key : e.getPropertyKeys())
					if (!key.equals("id"))
						sendEdgeAttributeAdded(sourceId, edgeId, key,
								e.getProperty(key));
			}

			t.success();
		} catch (Throwable e) {
			t.failure();
		} finally {
			t.finish();
		}
	}