Fabrice,
thanks for your observation. I've further simplified your code snippet to the one attached below.
This particular issue seems to be related with the Java binding, and not to the core itself. I've put this on our list; we'll give you an update after the bug has been fixed. In the meanwhile, you might want to use the execute() method..
System.out.println(cs.execute("xquery" + q)); System.out.println(cs.info());
Christian __________________________________________
import org.basex.server.*;
public class Example { public static final void main(String[] args) throws Exception { ClientSession cs = new ClientSession("localhost", 1984, "admin", "admin");
Query q = cs.query("1"); System.out.println(q.execute()); q.close();
cs.close();
cs = new ClientSession("localhost", 1984, "admin", "admin"); cs.execute("DROP DB xxx"); cs.close(); } } ___________________________
On Mon, Jan 24, 2011 at 2:31 PM, Fabrice Etanchaud fetanchaud@edital.com wrote:
Dear all, I get a very strange behaviour in client/server mode with the java binding (ckecked out from the repository). I wrote a little piece of code that never returns from the last command 'DROP DATABASE xxx' It ends up normally if you comment the query or if you change it to an iterative query. Please find the code below :
Best regards
import
org.basex.server.*;
import
java.io.*;
public
class Test {
public static final void main(String[] args) {
try {
ClientSession session =
new ClientSession("localhost", 1984, "admin", "admin");
session.create(
"mydb", new ByteArrayInputStream("<Root1/>".getBytes("UTF-8")));
session.execute(
"OPEN mydb");
session.add(
"mydoc.xml", "/mypath", new ByteArrayInputStream("<Root2/>".getBytes("UTF-8")));
session.execute(
"DELETE /mypath/mydoc.xml");
String req =
"for $i in collection() return base-uri($i)";
Query q = session.query(req);
System.
out.println(q.execute());
System.
out.println(q.info());
q.close();
session.execute(
"CLOSE");
session.close();
session =
new ClientSession("localhost", 1984, "admin", "admin");
session.execute(
"DROP DATABASE mydb");
session.close();
}
catch (Exception e) {
e.printStackTrace();
}
}
}
Fabrice Etanchaud
Senior Software Engineer
CT Corsearch / Edital, a Wolters Kluwer business
Berkenlaan 1
1831 Diegem
Belgium
skype:fabrice.etanchaud
Get Skype and call me for free.
fetanchaud@edital.com
www.edital.com (website)
www.ctcorsearch.com (website)
Confidentiality Notice: This email and its attachments (if any) contain confidential information of the sender. The information is intended only for the use by the direct addressees of the original sender of this email. If you are not an intended recipient of the original sender (or responsible for delivering the message to such person), you are hereby notified that any review, disclosure, copying, distribution or the taking of any action in reliance of the contents of and attachments to this email is strictly prohibited. If you have received this email in error, please immediately notify the sender at the address shown herein and permanently delete any copies of this email (digital or paper) in your possession.
BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk