From 33e0f11ea3dec08c78b0f10a192bad779565c704 Mon Sep 17 00:00:00 2001 From: jprocter Date: Tue, 20 Mar 2007 14:19:41 +0000 Subject: [PATCH] pass maintained hash of Vobject hash values to IdFactory so it can detect modified objects. git-svn-id: https://svn.lifesci.dundee.ac.uk/svn/repository/trunk@370 be28352e-c001-0410-b1a7-c7978e42abec --- src/uk/ac/vamsas/client/simpleclient/SimpleClient.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/uk/ac/vamsas/client/simpleclient/SimpleClient.java b/src/uk/ac/vamsas/client/simpleclient/SimpleClient.java index de2e00d..dc3df20 100644 --- a/src/uk/ac/vamsas/client/simpleclient/SimpleClient.java +++ b/src/uk/ac/vamsas/client/simpleclient/SimpleClient.java @@ -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) { -- 1.7.10.2