CmisSession.query immediately after createDocument does not find the document
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2016 06:25 PM
CmisSession.query immediately after createDocument operation does not find the document
Same query in CMIS workbench retrieves the result
Same query issued after few seconds retrieves
It appeared to be a CmisSession cache problem
So I changed my query issuing statement as below. Still does not seem to work…
The same code after a few seconds retrieve the expected results and work…
My initial session creation logic is…
Same query in CMIS workbench retrieves the result
Same query issued after few seconds retrieves
It appeared to be a CmisSession cache problem
So I changed my query issuing statement as below. Still does not seem to work…
OperationContext operationContext = cmisSession.createOperationContext();operationContext.setCacheEnabled(false);ItemIterable<QueryResult> results = cmisSession.query(cmisQuery, false, operationContext);
The same code after a few seconds retrieve the expected results and work…
My initial session creation logic is…
Map<String, String> parameter = new HashMap<String, String>(); parameter.put(SessionParameter.USER, this.user);parameter.put(SessionParameter.PASSWORD, this.password);parameter.put(SessionParameter.ATOMPUB_URL, this.host);parameter.put(SessionParameter.BINDING_TYPE, BindingType.ATOMPUB.value());repositories = sessionFactory.getRepositories(parameter);cmisRepository = repositories.get(0);parameter.put(SessionParameter.REPOSITORY_ID, cmisRepository.getId());cmisSession = sessionFactory.createSession(parameter);
Gnanasekaran Sakthivel
Labels:
- Labels:
-
Archive
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2016 09:36 AM
This was working before until I added the IN_TREE condition in the cmisQuery.
Gnanasekaran Sakthivel
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2016 07:16 PM
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.
There is a specific query type and limited syntax to "force" Alfresco to use the database rather than Solr which is only sparsely documented.
There is a specific query type and limited syntax to "force" Alfresco to use the database rather than Solr which is only sparsely documented.