6.5 - org.basex.server : basex never returns
Monday, 24 January 2011 · 4 messages · last reply 25 Jan 2011
FE
Fabrice Etanchaud24 Jan 2011 14:31 #
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?call> skype:fabrice.etanchaudGet Skype <http://www.skype.com/go/download> and call me for free.
fetanchaud at edital.com <mailto:fetanchaud at edital.com>
<http://www.edital.com/> www.edital.com (website)
<http://www.ctcorsearch.com/> 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.
CG
Christian Grün24 Jan 2011 17:11 #
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();
}
}Quoted text · Fabrice Etanchaud · 138 lines
On Mon, Jan 24, 2011 at 2:31 PM, Fabrice Etanchaud <fetanchaud at 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 at 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 at mailman.uni-konstanz.de > https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk >
AW
A. Weiler25 Jan 2011 09:50 #
Dear Fabrice,
this bug was caused of the closing method of the query object on the server-side. So it is resolved now in the svn repository.
Let me know if you need a jar version.
Kind regards,
Andreas
Quoted text · Christian Grün · 178 lines
Am 24.01.2011 um 17:11 schrieb Christian Grün: > 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 at 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 at 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 at mailman.uni-konstanz.de >> https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk >> > _______________________________________________ > BaseX-Talk mailing list > BaseX-Talk at mailman.uni-konstanz.de > https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
FE
Fabrice Etanchaud25 Jan 2011 10:52 #
Dear Andreas,
Thank you for your fast answer,
BaseX is impressive, but it's nothing compared to the DBIS team !
No need for jar, I will check out the repository.
Best regards,
Fabrice
Quoted text · A. Weiler · 192 lines
-----Original Message----- From: A. Weiler [mailto:andreas.weiler at uni-konstanz.de] Sent: mardi 25 janvier 2011 09:50 To: Fabrice Etanchaud Cc: basex-talk at mailman.uni-konstanz.de Subject: Re: [basex-talk] 6.5 - org.basex.server : basex never returns Dear Fabrice, this bug was caused of the closing method of the query object on the server-side. So it is resolved now in the svn repository. Let me know if you need a jar version. Kind regards, Andreas Am 24.01.2011 um 17:11 schrieb Christian Grün: > 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 at 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 at 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 at mailman.uni-konstanz.de >> https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk >> > _______________________________________________ > BaseX-Talk mailing list > BaseX-Talk at mailman.uni-konstanz.de > https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
Written for BaseX 6. BaseX may have changed since: please check the current documentation.
⚡Generated with XQuery