<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Problem starting Template Rendering Listener and fetching documents in Nuxeo Forum</title>
    <link>https://connect.hyland.com/t5/nuxeo-forum/problem-starting-template-rendering-listener-and-fetching/m-p/324097#M11098</link>
    <description>&lt;P&gt;Hi Gregory,&lt;/P&gt;
&lt;P&gt;thanks for your answer, but it is not the problem. Still MongoDB is tuned, the query:&lt;/P&gt;
&lt;P&gt;select * from Document where tmpl:forcedTypes/* &amp;lt;&amp;gt; 'none'&lt;/P&gt;
&lt;P&gt;return all documents because it is not transformed fine by MongoDBQueryBuilder. After query execution, you can find the "bucle" for all returned docs. This is the problem. The best solution for that is change the query to:&lt;/P&gt;
&lt;P&gt;select * from Document where tmpl:forcedTypes is not null and tmpl:forcedTypes/* &amp;lt;&amp;gt; 'none'&lt;/P&gt;
&lt;P&gt;Regards,
VS!&lt;/P&gt;</description>
    <pubDate>Thu, 22 Aug 2019 13:33:57 GMT</pubDate>
    <dc:creator>Victor_Sánchez</dc:creator>
    <dc:date>2019-08-22T13:33:57Z</dc:date>
    <item>
      <title>Problem starting Template Rendering Listener and fetching documents</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/problem-starting-template-rendering-listener-and-fetching/m-p/324095#M11096</link>
      <description>&lt;P&gt;Hi team,&lt;/P&gt;
&lt;P&gt;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 &lt;A href="https://github.com/nuxeo/nuxeo/blob/master/addons/nuxeo-template-rendering/nuxeo-template-rendering-core/src/main/java/org/nuxeo/template/service/TemplateMappingFetcher.java"&gt;https://github.com/nuxeo/nuxeo/blob/master/addons/nuxeo-template-rendering/nuxeo-template-rendering-core/src/main/java/org/nuxeo/template/service/TemplateMappingFetcher.java&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;It runs after TemplateInitListener.java listening for aboutToCreate event.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;@Override
public void run() {
   StringBuilder sb = new StringBuilder("select * from Document where ");
   sb.append(TemplateSourceDocumentAdapterImpl.TEMPLATE_FORCED_TYPES_ITEM_PROP);
   sb.append(" &amp;lt;&amp;gt; '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)) {
              ...
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This NXQL against MongoDB has a serious problem, even having indexes:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;select * from Document where tmpl:forcedTypes/* &amp;lt;&amp;gt; 'none'
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Regards,
VS!&lt;/P&gt;</description>
      <pubDate>Fri, 09 Aug 2019 12:04:09 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/problem-starting-template-rendering-listener-and-fetching/m-p/324095#M11096</guid>
      <dc:creator>Victor_Sánchez</dc:creator>
      <dc:date>2019-08-09T12:04:09Z</dc:date>
    </item>
    <item>
      <title>Re: Problem starting Template Rendering Listener and fetching documents</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/problem-starting-template-rendering-listener-and-fetching/m-p/324096#M11097</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;Performances are really related to the architecture you've set up. I encourage you to watch &lt;A href="https://university.nuxeo.com/learn/course/external/view/elearning/201/NuxeoReferenceArchitecture"&gt;https://university.nuxeo.com/learn/course/external/view/elearning/201/NuxeoReferenceArchitecture&lt;/A&gt;
to check your Nuxeo infrastructure, and in particuly:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Tune your MongoDB DB&lt;/LI&gt;
&lt;LI&gt;Dedicate some workers and/or Nuxeo Stream to handle bulk rendering&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Thu, 22 Aug 2019 13:02:25 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/problem-starting-template-rendering-listener-and-fetching/m-p/324096#M11097</guid>
      <dc:creator>Gregory_Carlin</dc:creator>
      <dc:date>2019-08-22T13:02:25Z</dc:date>
    </item>
    <item>
      <title>Re: Problem starting Template Rendering Listener and fetching documents</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/problem-starting-template-rendering-listener-and-fetching/m-p/324097#M11098</link>
      <description>&lt;P&gt;Hi Gregory,&lt;/P&gt;
&lt;P&gt;thanks for your answer, but it is not the problem. Still MongoDB is tuned, the query:&lt;/P&gt;
&lt;P&gt;select * from Document where tmpl:forcedTypes/* &amp;lt;&amp;gt; 'none'&lt;/P&gt;
&lt;P&gt;return all documents because it is not transformed fine by MongoDBQueryBuilder. After query execution, you can find the "bucle" for all returned docs. This is the problem. The best solution for that is change the query to:&lt;/P&gt;
&lt;P&gt;select * from Document where tmpl:forcedTypes is not null and tmpl:forcedTypes/* &amp;lt;&amp;gt; 'none'&lt;/P&gt;
&lt;P&gt;Regards,
VS!&lt;/P&gt;</description>
      <pubDate>Thu, 22 Aug 2019 13:33:57 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/problem-starting-template-rendering-listener-and-fetching/m-p/324097#M11098</guid>
      <dc:creator>Victor_Sánchez</dc:creator>
      <dc:date>2019-08-22T13:33:57Z</dc:date>
    </item>
  </channel>
</rss>

