Quantcast
Channel: Alfresco Forums - Alfresco API
Viewing all articles
Browse latest Browse all 252

CmisSession.query immediately after createDocument does not find the document

$
0
0

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

Viewing all articles
Browse latest Browse all 252

Trending Articles