I found it is much easier to use the REST API[0] to do anything with the DB data. HTTP module[1] might also come handy. Especially modifying documents is done by GETting the document, doing all the work locally and then PUTting it back, atomically replacing the old document.
IMO, constructing queries using strings is ugly and error prone.
Also, maybe it is better to let us know what you're trying to achieve in order to be able to offer you more specific answers.
[0]: http://docs.basex.org/wiki/REST [1]: http://docs.basex.org/wiki/HTTP_Module
On 17 June 2016 at 16:15, Kapoor, Sumit Sumit.Kapoor@adesso.de wrote:
Hello,
the Question is:
If I open a connection, send a query and close the connection: What do I get? Just a Copy of the Database which will be stored in the core/main memory or a reference to the DB? Here a Code Example:
let $cid := client:connect("localhost",port,"user","password")
let $query := 'collection("BIG-DB")/*:node'
let $req := client:query($cid,$query)
let $close := client:close($cid)
return $req
If it’s just a copy in the main memory than (depends on the size oft he DB) it will cost a lot of performance.
We have to use such a workaround with „client:connect“ because if we try to access directly the DB more than once it will be blocked.
So do you have any experience with the return value of „$req“ ? Is it still a reference of the DB or is it stored in the main memory?
Regards,
Sumit Kapoor
>>> business. people. technology. <<<
adesso AG mit Sitz in Dortmund Vorstand: Michael Kenfenheuer (Vors.), Christoph Junge, Andreas Prenneis Vorsitzender des Aufsichtsrates: Prof. Dr. Volker Gruhn Amtsgericht Dortmund HRB 20663