cancel
Showing results for 
Search instead for 
Did you mean: 

Performance Problem categoryService.setCategories

robobot
Champ in-the-making
Champ in-the-making
Hello, i have a perfomance problem with the categoryService.


   if(data.getCategories() != null){
     try {        
       Reference reference = new Reference(STORE, null, documentPath);
       Predicate predicate = new Predicate(new Reference[]{reference}, STORE, null);
       ArrayList<Reference> categoryList = new ArrayList<Reference>();
       AppliedCategory appliedCategory = new AppliedCategory();
      
       String category = ROOT_CATEGORY+data.getCategories()[0];
       Reference catRef = new Reference(STORE, null,category);    
       categoryList.add(catRef);
      
       appliedCategory.setCategories(categoryList.toArray(new Reference[0]));      
       appliedCategory.setClassification(ATTRIBUTE_CLASSIFICATION);
      
       AppliedCategory[] appliedCategories = new AppliedCategory[]{appliedCategory};      
       categoryService.setCategories(predicate, appliedCategories);
      
      }catch (Exception ex){       
         ex.printStackTrace();
      }
   }

if the fragment above is called in a loop, say 7 times, it seems that "categoryService.setCategories(predicate, appliedCategories);" took very long time for each entry. Can anybody give me a hint what maybe the problem here. Thank you.
1 REPLY 1

robobot
Champ in-the-making
Champ in-the-making
i find out deleting the default categories in alfresco will increase performance.