pass maintained hash of Vobject hash values to IdFactory so it can detect modified...
[vamsas.git] / src / uk / ac / vamsas / client / simpleclient / SimpleClient.java
index de2e00d..dc3df20 100644 (file)
@@ -61,7 +61,9 @@ public class SimpleClient implements IClient {
    * @return
    */
   private IdFactory makeVorbaIdFactory() {
-    return new IdFactory(getSessionHandle(), client, user);
+    if (extantobjects==null)
+      extantobjects=new Hashtable();
+    return new IdFactory(getSessionHandle(), client, user, extantobjects);
   }
   
   /**
@@ -316,12 +318,14 @@ public class SimpleClient implements IClient {
         log.debug("updateDocument for "+session.getSessionUrn()+" with unmodified IClientDocument (skipping the write)");
     } else {
       try {
-        if (!cdocument.updateSessionDocument()) {
+        boolean updated=cdocument.updateSessionDocument();
+        if (!updated) {
           log.warn("Session document did not update properly for session directory "+_session.sessionDir);
           // cdocument.archive.cancelArchive(); // LATER: could be done - would need to prevent updateSessionDocument closing the iohandler.
           _session.slog.warn("Session Document updated but may not be valid (false return from org.vamsas.simpleclient.ClientDocument.updateSessionDocument()");
+        } else {
+               log.debug("Document update successful.");
         }
-        log.debug("Document update successful.");
         _session.setUnsavedFlag();
       }
       catch (IOException e) {