Hi,

In order to maintain referential integrity during create or update, I wish 
to use traversals. The code will look somewhat like the following.

public void create(doc) {
try {
   db.begin(OTransaction.TXTYPE.OPTIMISTIC);
   ODocument createdDoc = doc.save();
   traverse(createdDoc.getIdentity());
   db.commit();
}catch( Exception e ){
   db.rollback();
}finally{
   db.close();
}

public void traverse(ORID rid) {
    for (OIdentifiable id : new OSQLSynchQuery<ODocument>("traverse * from " 
+ rid)) {
      logger.info(id.toString());
   }
}


I want traverse function to traverse the entire created document 
recursively and throw an exception if the referenced links are not found. 
How can I achieve this ?
Am using document database on orientdb-community-1.7-rc2

Thank you.

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to