AnsweredAssumed Answered

CmisSession.query immediately after createDocument does not find the document

Question asked by sepgs2004 on Jun 8, 2016
Latest reply on Jun 17, 2016 by rjohnson
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…


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);

Outcomes