newdoc.unlockFile();
log.debug("Transfer complete.");
}
-
+ /**
+ * extant archive IO handler
+ */
+ VamsasArchive _va=null;
/**
* Creates a VamsasArchive Vobject for accessing and updating document
* Note: this will lock the Vamsas Document for exclusive access to the client.
* @throws IOException if locks fail or vamsas document read fails.
*/
protected VamsasArchive getVamsasDocument() throws IOException {
- // TODO: check we haven't already done this once - probably should be done by caller
+ // check we haven't already done this once - probably should be done by caller
+ if (_va!=null)
+ return _va;
// patiently wait for a lock on the document. (from ArchiveClient.getUpdateable())
long tries=5000;
while (vamArchive.getLock()==null && --tries>0) {
* @throws IOException
*/
protected void unlockVamsasDocument() throws IOException {
+ if (_va!=null)
+ _va.closeArchive();
+ _va=null;
if (vamArchive!=null)
vamArchive.unLock();
+
}
/**
* create a uniquely named uk.ac.vamsas.client.simpleclient.ClientsFile.addClient(ClientHandle)ile in the session Directory