11-24-2018 05:57 AM
Hey Guys,
I have a method called "listData()" in which I query data from Alfresco with an AFTS query. When calling the method without anything has changed, the query workes fine. But when I add a Node like here:
and then call "listData()", the query doesn't give back the current created Node. That's a thing I do not understand because when I get the response from "createNode()" the Node should be successfully added to Database!
The query looks like this:
Do you have any Idea how to solve this issue?
11-25-2018 03:55 AM
I guess the query is using SOLR for searching and your are running the query just after the insertion. As SOLR is asynchronously indexing the content, the result is not available at this point.
Probably this session by Axel Faust can help you to understand the whole thing: [BeeCon 2017] - Axel Faust - Making proper use of transactional metadata queries - YouTube
11-26-2018 06:34 AM
Note that if you were to use CMIS for this type of query (date range, though without any fancy date math expressions) than Alfresco would be able to execute the query against the DB and you should have a consistent result immediately. Unfortunately Alfresco "forgot" to handle the necessary query rewrite logic for AFTS to support (a limited sub-set of) range queries against the DB.
Explore our Alfresco products with the links below. Use labels to filter content by product module.