session not associated with database

Tuesday, 9 March 2010 · 2 messages
SS
Swaminathan S9 Mar 2010 17:52 #
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
AW
Andreas Weiler9 Mar 2010 18:00 #
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.
Quoted text · Swaminathan S · 2 lines
> (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
Quoted text · Swaminathan S · 33 lines
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 at mailman.uni-konstanz.de > https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk >

⚡Generated with XQuery