Hi all,
Nice to be in this community!
We are currently doing a project on XML database using BaseX and using XQJ API to develop it in eclipse. What troubled us now is that when we doing an insertion or deletion, there is actually nothing changed in the XML file. Then I checked that it seems that XQJ is not available to XQuery update. Is it really like that? Otherwise, how can we write or delete things in the XML file?
Another problem: when we want to show what has been changed for the cached XML file, I get this notification:
''
According to the XQJ 1.0 Specification, executing expressions via XQPreparedExpression or XQExpression implicitly closes the previously created XQResultSequence object which was tied to the parent XQConnection object.
To keep a XQResultSequence alive and accessible, you could either create an immutable XQSequence by using XQConnection.createSequence(XQResultSequence) or modify the XQStaticContext's Scrollability property to ensure that future XQResultSequence objects will be "SCROLLABLE" (cached) and not "FORWARD_ONLY" (streamed).
Please read the XQJ.NET documentation for further details.'
I understand what does it mean but do not quite understand how to use XQConnection.createSequence(XQResultSequence) or modify the XQStaticContext's Scrollability property. Could you kindly give me some guidance on that?
My code is like:"
XQPreparedExpression aaa =xqc.prepareExpression(.......);
XQPreparedExpression bbb =xqc.prepareExpression(.......);
XQResultSequence rs = aaa.executeQuery();
XQResultSequence as = bbb.executeQuery();
while(rs.next())
System.out.println(rs.getItemAsString(null));
System.out.println(as.getItemAsString(null));"
Many thanks!
Cong Liu