         return result;
     }
     
-    public func update(aNode: Node) {
-        nodeStore.updateValue(aNode)
-    }
-
-    public func deleteNode(inout aNode: Node) {
+    public func update(inout aNode: Node) {
+        if aNode.dirty {
+            nodeStore.updateValue(aNode)
+            
+            aNode.dirty = false
+        }
+    }
+
+    public func delete(inout aNode: Node) {
         nodeStore.delete(aNode)
-        
         aNode.context = nil;
     }
 

//let cStringStoreFileName       = "stringstore.db"

public protocol Context {
     weak var context : GraphContext! { get set }
}

public class GraphContext {

        aRelationship.context = self
    }
    
    func update(inout aRelationship: Relationship) {
        if aRelationship.dirty {
            relationshipStore.updateValue(aRelationship)
            
            aRelationship.dirty = false
        }
    }

    public func readRelationship(uid:UID) -> Relationship? {
