It makes no difference for the BaseX server if you close the session and have open query objects (query objects exclusively reside in the client).

It can make a difference in client implementations, though. If you have a chance to always close queries after the execution, I think you should do so. I assume your are caching the query results before iterating over them, as it’s some in the other client implementations?




Ben Engbers <Ben.Engbers@be-logical.nl> schrieb am Mo., 3. Feb. 2020, 11:01:
Hi,

The people from CRAN strongly suggested to add tests (comparable to
Unit-tests) to my package (RBaseX). Their request led me to take another
critical look at my code.
So far the tests do not give an error message. But after completing the
last test, 'testthat' reports 1 failure without further explanation.
After changing the order in which the tests are executed, the failure is
always caused by the last test. Therefore I think that it are not the
tests that cause an error, but the finalize-process.

At this moment, my code is based upon 3 classes: 'RBaseXClient' creates
a new client-session. This session use 'SocketClass' to communicate with
basexserver.  When used in query-mode, the session uses 'QueryClass' to
create new query-objects. Due to this architecture, it is easy to
explicitly close a regular query-object, but (at least in R) it is
difficult to close query-objects when finalizing the session-object.

How does the basexserver respond to closing the session without first
explicitly closing all open querys? Does this result in an error?

Ben