AnsweredAssumed Answered

Sometimes i can found the space, sometimes can't

Question asked by skwig on Oct 23, 2008
Latest reply on Nov 21, 2008 by libman
Hi,

I'm using Alfresco labs and I have a space named "ALIEN" in Alfresco,which is found from my application this way:


    ResultSetRow[] rows= null;
    String found= "";
    String space= "ALIEN";
    String search= "@\\{http\\://www.alfresco.org/model/content/1.0\\}name:\"" + space+ "\"";
            Query query = new Query();
            query.setLanguage(Constants.QUERY_LANG_LUCENE);
            query.setStatement(search);

            try {
                QueryResult qrst = WebServiceFactory.getRepositoryService().query(ALF_STORE, query, false);
                ResultSet x = qrst.getResultSet();
                rows = x.getRows();   //THIS IS THE CONFLICTIVE LINE
                for (ResultSetRow aux : rows ) {
                    for (NamedValue aux2 : aux.getColumns()) {
                        if (ALF_NAME.equals(aux2.getName())) {
                            found= aux;
                        }
                    }
                }


Sometimes "rows" is null (Space "ALIEN" exists in Alfresco, and the user which makes this search has permission at this space). It is curious that sometimes "rows" gets me information, and sometimes is null.

What's happening?

Thanks for your time.

Outcomes