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
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
Op 04-02-2020 om 08:17 schreef Christian Grün:
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?
Hi Christian,
I used the java-client as example, so yes, I cam caching the query results. I will begin by explicitly closing all the querys, closing the socketconnection and removing the session-objects. Hopefully this will show what's causing the failure.
Ben (The people from CRAN warned that this can be very difficult and can cause severe headache ;-( )
basex-talk@mailman.uni-konstanz.de