     
     let url: NSURL
     var error: NSError?  // readonly?
+    var temporary = false  // // delete data wrapper after closing the context
     
     var nodeStore: SOCacheDataStore!
     var relationshipStore: SOCacheDataStore!

        setupFileStores()
    }


    func setupFileStores() {
        

        self.relationshipStore.cache.delegate = newValue;
        self.propertyStore.cache.delegate = newValue;
    }
    
    //#pragma mark - CRUD Node
    
    // No add method, node has no parameter they need just created
    func createNode() -> SONode {
        
        // TODO should support generics
        let result = self.nodeStore.createObject() as SONode
        
        //TODO
        //result.context = self
        
        return result;
    }
    
    func readNode(aID: UInt64) -> SONode? {
        
        //NSParameterAssert(aID != 0);
        
        var result : SONode? = nil //self.nodeStore.readObject(aID)
        
        //TODO
        //result.context = self
        
        return result;
    }
    
    func updateNode(aNode: SONode) {
        self.nodeStore.updateObject(aNode)
    }

    func deleteNode(aNode: SONode) {
        self.nodeStore.deleteObject(aNode)
        
        aNode.context = nil;
    }

    
    // #pragma mark - CRUD Relationship
    
    func updateRelationship(aRelationship: SORelationship) {
        self.relationshipStore.updateObject(aRelationship)
    }
    
    func deleteProperty(aRelationship: SORelationship) {
        self.relationshipStore.deleteObject(aRelationship)
        
        aRelationship.context = nil;
    }

    // #pragma mark - CRUD Property
    
    
    func updateProperty(aProperty: SOProperty) {
        self.propertyStore.updateObject(aProperty)
    }

    func deleteProperty(aProperty: SOProperty) {
        self.propertyStore.deleteObject(aProperty)
        
        aProperty.context = nil;
    }
    
    //#pragma mark - CRD Strings
    
    
    func addString(text: String) -> Int {
        let num =  self.stringStore.addString(text)
        
        // TODO
        return num.integerValue;
    }
    
    func readStringAtIndex(index: UInt) -> String? {
        return self.stringStore.readStringAtIndex(index)
    }

    func deleteStringAtIndex(index: UInt) {
        self.stringStore.deleteStringAtIndex(index)
    }

}



/**
#pragma mark - Transaction Handling

- (NSNumber *)startTransaktion;
- (void)endTransaktion:(NSNumber *)transactionID;
*/

