Hi,
In a client-server interaction with BaseX database, I see the ClientSession object is not associated with a database, in the usual manner(Usually, a session is established with a particular database at session creation time). Please let me know if my understanding is right: When we I do the following: *Line 1*: ClientSession session = new ClientSession("localhost", 1984, "admin", "admin"); *Line 2*: session.execute("OPEN databaseA"); *Line 3*: session.execute("XQUERY <some xquery>");
*Does "Line 2" bind the session with databaseA?(*So, I am assured that Line 3 executes on databaseA?)
Thanks and regards,
Swaminathan Sahiram
Hi Swaminathan,
yes you're right. The ClientSession object is just associated with a database after you executed the "open database" command. You can access all databases (without opening them) with the 'doc' function of xquery.
(Usually, a session is established with a particular database at session creation time)
This would be bad, if you want to have the chance to open and close databases without recreating your session.
Kind regards, Andreas
Swaminathan S schrieb:
Hi,
In a client-server interaction with BaseX database, I see the ClientSession object is not associated with a database, in the usual manner(Usually, a session is established with a particular database at session creation time). Please let me know if my understanding is right: When we I do the following: *Line 1*: ClientSession session = new ClientSession("localhost", 1984, "admin", "admin"); *Line 2*: session.execute("OPEN databaseA"); *Line 3*: session.execute("XQUERY <some xquery>");
*Does "Line 2" bind the session with databaseA?(*So, I am assured that Line 3 executes on databaseA?)
Thanks and regards,
Swaminathan Sahiram
BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
basex-talk@mailman.uni-konstanz.de