Problem starting Template Rendering Listener and fetching documents

Hi team,

I have detected a problem starting Nuxeo. With a 100M documents instance, the deployment is very slow, and looking for the problem, I found this source code into https://github.com/nuxeo/nuxeo/blob/master/addons/nuxeo-template-rendering/nuxeo-template-rendering-core/src/main/java/org/nuxeo/template/service/TemplateMappingFetcher.java

It runs after TemplateInitListener.java listening for aboutToCreate event.

@Override
public void run() {
   StringBuilder sb = new StringBuilder("select * from Document where ");
   sb.append(TemplateSourceDocumentAdapterImpl.TEMPLATE_FORCED_TYPES_ITEM_PROP);
   sb.append(" <> 'none'");
   DocumentModelList docs = session.query(sb.toString());
   for (DocumentModel doc : docs) {
      TemplateSourceDocument tmpl = doc.getAdapter(TemplateSourceDocument.class);
      if (tmpl != null) {
         for (String type : tmpl.getForcedTypes()) {
             if (mapping.containsKey(type)) {
              ...

This NXQL against MongoDB has a serious problem, even having indexes:

select * from Document where tmpl:forcedTypes/* <> 'none'

Regards, VS!

0 votes

0 answers

67 views

ANSWER