Downloads Documentation Community Contribute Demo






Show Sidebar
Login | Register
Show
Ignore:
Timestamp:
05/15/08 20:15:52 (8 months ago)
Author:
bwolfe
Message:

Merging trunk to api-refactoring [4191]:[4230]

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • openmrs/branches/api_refactoring/src/api/org/openmrs/api/impl/AdministrationServiceImpl.java

    r4198 r4231  
    574574                Context.getConceptService().checkIfLocked(); 
    575575 
    576                 int count = 0; 
    577                 for (Concept concept : Context.getConceptService() 
    578                                               .getConceptsByName("")) { 
    579                         updateConceptWord(concept); 
    580                         if (count++ > 1000) { 
    581                                 Context.clearSession(); 
    582                                 count = 0; 
    583                         } 
     576                // Run the operation in batches 
     577                ConceptService cs = Context.getConceptService(); 
     578                int batchStartId = 0; 
     579                int endId = cs.getNextAvailableId(); 
     580                int batchSize = 1000; 
     581                 
     582                while (batchStartId < endId) 
     583                { 
     584                        updateConceptWords(batchStartId, batchStartId + batchSize); 
     585                        Context.clearSession(); 
     586                        batchStartId += batchSize; 
    584587                } 
    585588