chemistry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Streit <mcs...@gmail.com>
Subject QueryResult.getTotalNumItems() reporting 2 when there is only 1 result as expected
Date Mon, 07 Oct 2013 22:11:48 GMT
Chemistry folks

We are running into an odd issue where a CMIS Query run via the Chemistry
Workbench returns 1 record *as expected* but when the EXACT same CMIS SQL
is executed in code, the call to the method QueryResult.*getTotalNumItems*()
is returning 2.  This is of course causing problems as it is expected in
this particular use case to return either 0 or 1 only.

The code to process the query is done like this:

            QueryStatement queryStatement =
cmisServices.getCmisSession().createQueryStatement(query);
            queryStatement.setString(1, parentFolder1);
            queryStatement.setString(2, childFolder1); // look for target
folder within the tree...

            ItemIterable<QueryResult> queryResult =
queryStatement.query(false).getPage(500);

The queryStatement String (with bound values) looks like this:

SELECT * FROM cmis:folder WHERE
IN_TREE('workspace://SpacesStore/2ba621d5-d8ad-4cd2-bdf4-b0e9a64a170e') AND
cmis:name= 'ABC124DEF456'



   - Chemistry Workbench returns: 1  - CORRECT
   - CMIS  Node Browser in Alfresco 4.1.4 returns: 1 - CORRECT
   - Coded test program results in this statement below returning: *2 -
   INCORRECT*


               LOGGER.info("***queryResult.getTotalNumItems() " +
queryResult.getTotalNumItems());

Running with Apache Chemistry 0.8.0 and Alfresco Enterprise 4.1.4  and
using the CMIS AtomPuib binding


Is it possible that this is a bug we've hit being on the Chemistry 0.8.0
RELEASE?

Thanks

Mark

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message