Hi Christian,
Thanks, that sorted the issue!
What threw me was that queries that do a select don't need the execute call in order to work:
final String xQuery = String.format("for $tab in doc('db')//tabs/tab[@id='%s'] return data($tab/content/h3)", //$NON-NLS-1$ this.tabId); final ClientQuery checkQuery = new ClientQuery(xQuery, SSCCE.SESSION, SSCCE.SESSION.getOutputStream()); try { if (checkQuery.more()) { System.out.println(checkQuery.next()); } } finally { checkQuery.close(); }
So likely more calls execute...
I sent a SSCCE to Jens yesterday.
/ Chris
On 07/08/2013 01:05, "Christian Grün" christian.gruen@gmail.com wrote:
Hi Christoph,
two little observations that might help you to improve your queries:
new ClientQuery(xQueryUpdate, SESSION,
SESSION.getOutputStream()).close();
You need to execute your query, otherwise, this will be a no-op operation:
ClientQuery cq = SESSION.query(xQueryUpdate); cq.execute(); cq.close();
// System.out.println(new
XQuery(xQueryUpdate).execute(CONTEXT));
In this line, you are a circumventing the client/server context, which could lead to your error message.
If you manage to create a minimized example, that¹d be helpful.
Best, Christian