Changeset 31123

Show
Ignore:
Timestamp:
17.11.2016 16:34:09 (3 years ago)
Author:
ak19
Message:

Using the document editor, showed up that multiple metadata editing/deleting/adding was not guaranteed to take place in sequence. This code 1. ensures that the sequence is maintained by locking the collection while each individual metaaction takes place; 2. fixes an oversight in the code to do with reserving/locking the collection.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/GS2Construct.java

    r30704 r31123  
    317317        } 
    318318 
    319         return runCommand(request, GS2PerlConstructor.MODIFY_METADATA_SERVER); 
     319        // wait until we can reserve the collection for processing 
     320        waitUntilReady(request);     
     321         
     322        // process 
     323        Element response = runCommand(request, GS2PerlConstructor.MODIFY_METADATA_SERVER); 
     324         
     325        // release hold on collection 
     326        signalReady(request); 
     327        return response; 
    320328    } 
    321329 
     
    892900        } 
    893901 
    894         while (collectionOperationMap.get(collection) != null) 
     902        while (!checkCollectionIsNotBusy(collection)) // When the collection ceases to be busy, we place a hold on it 
    895903        { 
    896904            try 
     
    915923    } 
    916924 
     925    // If collection is NOT busy, then reserve it 
    917926    protected synchronized boolean checkCollectionIsNotBusy(String collection) 
    918927    {