if(!(repoClient instanceof RepositoryJavaClientImpl)) {\r
throw new InternalError("updateAuthorityRefDocs() called with unknown repoClient type!");\r
}\r
- try {\r
- final int pageSize = N_OBJS_TO_UPDATE_PER_LOOP; \r
+ try { // REM - How can we deal with transaction and timeout issues hear.\r
+ final int pageSize = N_OBJS_TO_UPDATE_PER_LOOP; // Set a limit of num of objects -something like 1000K objects and also add a log Warning after some threshold\r
int pageNumProcessed = 1;\r
while(true) { // Keep looping until we find all the refs.\r
logger.debug("updateAuthorityRefDocs working on page: "+pageNumProcessed);\r
// Note that we always ask the Repo for the first page, since each page we process\r
// should not be found in successive searches. Slightly inefficient, but more\r
// reliable (stateless).\r
- DocumentModelList docList = findAuthorityRefDocs(ctx, repoClient, repoSession,\r
+ DocumentModelList docList = findAuthorityRefDocs(ctx, repoClient, repoSession, //is there an orderBy clause? set the orderby clause to something non-transient like createAt\r
getRefNameServiceTypes(), oldRefName, refPropName,\r
- queriedServiceBindings, authRefFieldsByService, null, pageSize, 0, false);\r
+ queriedServiceBindings, authRefFieldsByService, null, pageSize, 0, false /*don't compute total*/); //loop through the pages until we're finished -i.e., don't just keep getting the first page\r
\r
if((docList == null) // found no authRef fields - nothing to do\r
|| (docList.size() == 0)) { // No more to handle\r