jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "angela (Commented) (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (JCR-3089) javax.jcr.RepositoryException when trying to run an SQL2 query via Davex
Date Tue, 04 Oct 2011 09:48:34 GMT

    [ https://issues.apache.org/jira/browse/JCR-3089?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13119981#comment-13119981
] 

angela commented on JCR-3089:
-----------------------------

quickly had a look at the proposed patch and noticed that it uses jackrabbit-core specific
functionality:

+import org.apache.jackrabbit.core.query.lucene.join.JoinRow;

the aim of the jcr-server project however was not to rely on jackrabbit-core specific features.
as far as i remember there is otherwise not dependency to jackrabbit-core (there was one in
the transaction handling which we commented later on with the remark: 
"// commented, since server should be jackrabbit independent".)

i would therefore suggest that we try to find a solution that doesn't rely on jackrabbit-core.
was
that feasible?
                
> javax.jcr.RepositoryException when trying to run an SQL2 query via Davex
> ------------------------------------------------------------------------
>
>                 Key: JCR-3089
>                 URL: https://issues.apache.org/jira/browse/JCR-3089
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-jcr-server, jackrabbit-spi2dav
>            Reporter: Lukas Kahwe Smith
>         Attachments: JCR-3089.patch
>
>
> see the following thread for details:
> http://www.mail-archive.com/users@jackrabbit.apache.org/msg17975.html
> assuming a data structure as follows:
> /foo [nt:unstructured]
> /foo/bar [nt:unstructured]
> /foo/bar@lala = huii (lala is string property of bar)
> /ding [nt:unstructured]
> /ding@dong = ##barUUID### (dong is a property of type "Reference")
> then the following code will throw an exception:
> DavexClient Client = new DavexClient(url);
> Repository repo = Client.getRepository();
> Credentials sc = new SimpleCredentials("admin","admin".toCharArray());
> Session s = repo.login(sc,workspace);
> QueryManager qm = s.getWorkspace().getQueryManager();
> String sql = "SELECT data.* FROM [nt:unstructured] AS data WHERE data.lala= 'huii'";
> sql = "SELECT * FROM [nt:unstructured] AS data INNER JOIN [nt:unstructured] AS referring
ON referring.[dong] = data.[jcr:uuid] WHERE data.lala = 'huii'";
> sql = "SELECT * FROM [nt:unstructured] AS data INNER JOIN [nt:unstructured] AS referring
ON ISDESCENDANTNODE(data, referring) WHERE data.lala = 'huii'";
> Query query = qm.createQuery(sql, Query.JCR_SQL2);
> QueryResult qr = query.execute();
> The first query works just fine and I can iterate over the result. Neither the second
nor the third query works.
> In both cases I end up with a javax.jcr.RepositoryException. Note the exception only
happens if the query returns results. Aka a join will work just fine if it matches no rows.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message