| 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; |
|---|