Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 904969
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T16:08:18+00:00 2026-05-15T16:08:18+00:00

[ Solved , it seems that there was some bug affecting Alfresco 3.3.0, which

  • 0

[Solved, it seems that there was some bug affecting Alfresco 3.3.0, which is no longer present on Alfresco 3.3.0g]

Hi,

I’m using OpenCMIS to retrieve data from Alfresco 3.3, but it’s having a very weird behaviour on CMISQL queries. I’ve googled somebody else with the same problems, but it seems I’m the first one all over the world :), so I guess it’s my fault, not OpenCMIS’.

This is how I’m querying Alfresco:

public Class CmisTest {
    private static Session sesion;

    private static final String QUERY = "select cmis:objectid, cmis:name from cmis:folder where cmis:name='MyFolder'";

    public static void main(String[] args) {
        // Open a CMIS session with Alfresco
        Map<String, String> params = new HashMap<String, String>();
        params.put(SessionParameter.USER, "admin");
        params.put(SessionParameter.PASSWORD, "admin");
        params.put(SessionParameter.ATOMPUB_URL, "http://localhost:8080/alfresco/s/api/cmis");
        params.put(SessionParameter.BINDING_TYPE, BindingType.ATOMPUB.value());
        params.put(SessionParameter.REPOSITORY_ID, "fa9d2553-1e4d-491b-87fd-3de894dc7ca9");
        sesion = SessionFactoryImpl.newInstance().createSession(params);

        // Ugly bug in Alfresco which raises an exception if we request more data than it's available
        // See https://issues.alfresco.com/jira/browse/ALF-2859
        sesion.getDefaultContext().setMaxItemsPerPage(1);

        // We repeat the same query 20 times and count the number of elements retrieved each time
        for (int i = 0; i < 20; i++) {
            List<QueryResult> result = doQuery();
            System.out.println(result.size() + " folders retrieved");
        }
    }

    public static List<QueryResult> doQuery() {
        List<QueryResult> result = new LinkedList<QueryResult>();
        try {
            int page = 0;
            while (true) {
                ItemIterable<QueryResult> iterable = sesion.query(QUERY, false).skipTo(page);
                page++;
                for (QueryResult qr : iterable) {
                    result.add(qr);
                }
            }
        } catch (Exception e) {
            // We will always get an exception when Alfresco has no more data to retrieve... :(
            // See https://issues.alfresco.com/jira/browse/ALF-2859
        }
        return result;
    }

}

As you can see, we just execute the same query, up to 20 times in a row. You would expect the same result each time, wouldn’t you? Unfortunately, this is a sample of what we get:

1 folders retrieved
1 folders retrieved
1 folders retrieved
0 folders retrieved
0 folders retrieved
0 folders retrieved
0 folders retrieved
0 folders retrieved
1 folders retrieved
1 folders retrieved

Sometimes we get 20 1 in a row, sometimes it’s all 0. We have never get a “mix” of 1 and 0, though; we always get “a run” of them.

It does not matter if we create the session before each query, we still have the random issue. We have tried against two different Alfresco servers (both of them 3.3 Community), clean installation, and they both fail randomly. We also tried to measure the time for each query, but it doesn’t seem to have any relation with the result being wrong (0 folders retrieved) or right (1 folders retrieved).

Alfresco seems to be working fine: if we go to “Administration –> Node browser” and launch the CMISQL query from there, it always retrieves one folder, which is right. So, it must be our code, or an OpenCMIS bug…

Any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T16:08:18+00:00Added an answer on May 15, 2026 at 4:08 pm

    I can’t reproduce this behavior. It’s running fine against http://cmis.alfresco.com . The issue https://issues.alfresco.com/jira/browse/ALF-2859 states that there have been bug fixes. Are you running the latest Alfresco version?

    Florian

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

it seems that I just solved my problem why I couldn't use the ASP.NET
Edit : Solved, there was a trigger with a loop on the table (read
I've just solved another *I-though-I-was-using-this-version-of-a-library-but-apparently-my-app-server-has-already-loaded-an-older-version-of-this-library-*issue (sigh). Does anybody know a good way to verify
I have a problem, which I do not seem to be able to solve...
SOLVED: Nevermind, the links were visited, and the border definition was missing for visited
Update: Solved, with code I got it working, see my answer below for the
Problem solved: Thanks guys, see my answer below. I have a website running in
I've actually solved this, but I'm posting it for posterity. I ran into a
edit #2: Question solved halfways. Look below As a follow-up question, does anyone know
Edit: I have solved this by myself. See my answer below I have set

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.