Skip to content

Conversation

@adamretter
Copy link
Contributor

@adamretter adamretter commented May 20, 2021

Closes #3889

Previously Library Modules were reset with the wrong context, i.e. they were provided with the Main Module's context and not the Library Module's Context.
This meant that not all resources stored in context variables were correctly cleaned up, therefore leaking resources and memory. In addition reset was previously called more than once for the same module which was unnecessary; therefore we should also see a small performance improvement from this fix.

Many thanks to @xatapult and @PieterLamers for their patience in reporting this and helping to track down the issue.
As a result all SQL Connections should now also be correctly and implicitly closed when a query finishes execution.

@adamretter adamretter added the bug issue confirmed as bug label May 20, 2021
@adamretter adamretter added this to the eXist-5.3.0 milestone May 20, 2021
…as not enforced in eXist-db, and so accidentally internally xs:integer was being used. This has now been corrected
@adamretter adamretter force-pushed the bugfix/close-sql-connection-from-library-module branch from f346c75 to 8ccc301 Compare June 1, 2021 17:37
@adamretter adamretter marked this pull request as ready for review June 3, 2021 17:42
context, this meant that not all resources stored in context variables were correctly cleaned up, therefore leaking resources and memory. In addition reset was previously called more than once for the same module which was unecessary.
Closes eXist-db#3889
@adamretter adamretter force-pushed the bugfix/close-sql-connection-from-library-module branch from 29f2207 to 7f04fc9 Compare June 3, 2021 17:54
@adamretter adamretter changed the title Implicitly close SQL connections in library modules Cleanup all module contexts Jun 3, 2021
@adamretter adamretter requested a review from dizzzz June 3, 2021 17:54
Copy link
Member

@dizzzz dizzzz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sonarqubecloud
Copy link

sonarqubecloud bot commented Jun 3, 2021

@dizzzz dizzzz merged commit e371efd into eXist-db:develop Jun 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug issue confirmed as bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SQL Pooling mechanism does not always return connections

2 participants