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?
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
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.
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.