Changeset 31127

Show
Ignore:
Timestamp:
18.11.2016 14:53:41 (3 years ago)
Author:
ak19
Message:

Related to previous revision (31125). Fix to concurrency problem when setting multiple metadata using doc editor 1. Better reporting in the status element of the response returned after setting metadata, now it indicates that it has finished setting meta on success. 2. Removed debug statements from experimental fix. 3. Not using logger error for info message in MessageRouter?.

Location:
main/trunk/greenstone3/src/java/org/greenstone/gsdl3
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/src/java/org/greenstone/gsdl3/core/MessageRouter.java

    r30840 r31127  
    262262        // gets removed from where it was. This changes the node list - you cant iterate over the node list in a normal manner if you are moving elements out of it 
    263263        int num_requests = requests.getLength(); 
    264         logger.error("**** num requests = "+num_requests); 
     264        logger.info("**** num requests = "+num_requests); 
    265265        for (int i = 0; i < num_requests; i++) 
    266266        { 
     
    269269            if (req == null) 
    270270            { 
    271                 logger.error("request " + i + " is null"); 
     271                logger.warn("request " + i + " is null"); 
    272272                continue; 
    273273            } 
  • main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/GS2Construct.java

    r31125 r31127  
    317317        return result; 
    318318        } 
    319  
    320319         
    321320        // wait until we can reserve the collection for processing 
    322         waitUntilReady(request);     
    323          
    324         logger.error("@@@ RESERVED"); 
     321        waitUntilReady(request); 
     322     
    325323         
    326324        // process 
     
    329327        if (response.getElementsByTagName(GSXML.ERROR_ELEM).getLength() <= 0) // if no errors, wait for process to finish 
    330328        { 
    331             logger.error("@@@ NO ERRORS"); 
    332              
    333329            Element statusElem = (Element) response.getElementsByTagName(GSXML.STATUS_ELEM).item(0); 
    334330            String id = statusElem.getAttribute("pid"); 
    335             logger.error("@@@ GOT PID: " + id); 
    336331             
    337332            GS2PerlListener currentListener = this.listeners.get(id); 
     
    342337                // there is probably a better way to do this. 
    343338                try 
    344                 { 
    345                     logger.error("@@@ WAITING"); 
     339                {        
    346340                    Thread.currentThread().sleep(100); 
    347341                } 
     
    351345                statusCode = currentListener.getStatus(); 
    352346            }        
    353         } 
     347        }        
    354348         
    355         else { 
    356             logger.error("@@@ GOT ERROR");           
    357         } 
    358          
    359         logger.error("@@@ RELEASING HOLD"); 
     349        Element statusElem = (Element) response.getElementsByTagName(GSXML.STATUS_ELEM).item(0); 
     350        String statusString = GSXML.getNodeText(statusElem); 
     351        statusString += " and monitored until done.";  
     352        GSXML.setNodeText(statusElem, statusString); 
    360353         
    361354        // release hold on collection