<?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 CmisSession.query immediately after createDocument does not find the document in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/cmissession-query-immediately-after-createdocument-does-not-find/m-p/300249#M253379</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;CmisSession.query immediately after createDocument operation does not find the document&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Same query in CMIS workbench retrieves the result&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Same query issued after few seconds retrieves&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It appeared to be a CmisSession cache problem&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So I changed my query issuing statement as below. Still does not seem to work…&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;OperationContext operationContext = cmisSession.createOperationContext();&lt;BR /&gt;operationContext.setCacheEnabled(false);&lt;BR /&gt;ItemIterable&amp;lt;QueryResult&amp;gt; results = cmisSession.query(cmisQuery, false, operationContext);&lt;BR /&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The same code after a few seconds retrieve the expected results and work…&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My initial session creation logic is…&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;Map&amp;lt;String, String&amp;gt; parameter = new HashMap&amp;lt;String, String&amp;gt;();&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;parameter.put(SessionParameter.USER, this.user);&lt;BR /&gt;parameter.put(SessionParameter.PASSWORD, this.password);&lt;BR /&gt;parameter.put(SessionParameter.ATOMPUB_URL, this.host);&lt;BR /&gt;parameter.put(SessionParameter.BINDING_TYPE, BindingType.ATOMPUB.value());&lt;BR /&gt;&lt;BR /&gt;repositories = sessionFactory.getRepositories(parameter);&lt;BR /&gt;cmisRepository = repositories.get(0);&lt;BR /&gt;&lt;BR /&gt;parameter.put(SessionParameter.REPOSITORY_ID, cmisRepository.getId());&lt;BR /&gt;cmisSession = sessionFactory.createSession(parameter);&lt;BR /&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 08 Jun 2016 22:25:15 GMT</pubDate>
    <dc:creator>sepgs2004</dc:creator>
    <dc:date>2016-06-08T22:25:15Z</dc:date>
    <item>
      <title>CmisSession.query immediately after createDocument does not find the document</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/cmissession-query-immediately-after-createdocument-does-not-find/m-p/300249#M253379</link>
      <description>CmisSession.query immediately after createDocument operation does not find the documentSame query in CMIS workbench retrieves the resultSame query issued after few seconds retrievesIt appeared to be a CmisSession cache problemSo I changed my query issuing statement as below. Still does not seem to w</description>
      <pubDate>Wed, 08 Jun 2016 22:25:15 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/cmissession-query-immediately-after-createdocument-does-not-find/m-p/300249#M253379</guid>
      <dc:creator>sepgs2004</dc:creator>
      <dc:date>2016-06-08T22:25:15Z</dc:date>
    </item>
    <item>
      <title>Re: CmisSession.query immediately after createDocument does not find the document</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/cmissession-query-immediately-after-createdocument-does-not-find/m-p/300250#M253380</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;This was working before until I added the IN_TREE condition in the cmisQuery.&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Jun 2016 13:36:25 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/cmissession-query-immediately-after-createdocument-does-not-find/m-p/300250#M253380</guid>
      <dc:creator>sepgs2004</dc:creator>
      <dc:date>2016-06-09T13:36:25Z</dc:date>
    </item>
    <item>
      <title>Re: CmisSession.query immediately after createDocument does not find the document</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/cmissession-query-immediately-after-createdocument-does-not-find/m-p/300251#M253381</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The issue is likely that the indexer (Solr) is asynchronous so if you create a document and then immediately search for it it is highly likely it will not be found unless you phrase your query to use the dtatabase rather than Solr.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;There is a specific query type and limited syntax to "force" Alfresco to use the database rather than Solr which is only sparsely documented.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 23:16:55 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/cmissession-query-immediately-after-createdocument-does-not-find/m-p/300251#M253381</guid>
      <dc:creator>rjohnson</dc:creator>
      <dc:date>2016-06-16T23:16:55Z</dc:date>
    </item>
  </channel>
</rss>

