Is using LocalSession safe if there can be concurrent queries through the native interface, i.e. concurrent ClientSession (and of course other LocalSession) accesses?
Yes; both LocalSession and ClientSession instances take advantage of our locking architecture and can be used in parallel (as long as the server instance and the LocalSession use the same instance of the Context class).
- "basexhttp -l" starts just the API (local mode)
- "basexhttp -r" starts the API and connects to a remote BaseX server to
execute the queries etc. on (remote mode)
Your proposal is worth discussing. I'm still not sure, though, how to name such an additional option, and how to make it as self-explanatory as possible: if no alternative host name will be specified by the user, "remote" is rather confusing imho, as the database server will be located on "localhost", i.e., the same machine. – After all, the reason for the current approach was to reduce the number of options that would otherwise need more explanation, and could make things even more complicated (we even thought about completely discarding the local flag).
But maybe I just have a strange intuition ;-)
Not at all.. And I still like the idea of directly communicating to the server and avoiding the ClientSession if it resides in the same JVM (it's mainly a question of how to implement it most properly).
Thanks for caring, Christian