Skip to content

Conversation

@wehnersteffensielaff
Copy link
Contributor

Pull Request Checklist

Please check if your Pull Request fulfills the following requirements:

  • The commit message has a detailed description of the modifications
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

Pull Request Type

What kind of change does this Pull Request introduce?

[x] Bugfix
[x] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[x] Build related changes
[x] CI related changes
[ ] Documentation content changes
[ ] Other (Please describe)

What is the current behavior?

CWF::SqldatabaseStorage can only handle one database per application properly

Issue Number: N/A

What is the new behavior?

CWF::SqldatabaseStorage will handle more than database per application properly given they have different connection names

Does this Pull Request introduce a breaking change?

[] Yes
[x] No

Other information

form more information see commit c8eb66b

wehnersteffensielaff and others added 9 commits January 17, 2019 16:05
As far as I can tell by now Qt really does not assume that running out of memory
is a failure mode in a enviroment that their framework is supposed to run in.
with the old implementation there was a issue where you could really only
use one database with CWF::SqlDatabaseStorage in you're application.
This was due to the fact that CWF::SqlDatabaseStorage::getDatabase would always
return the first database connection created on the executing thread.
It would possibly ignore Configuration given to CWF::SqlDatabaseStorage which
a user might not expect. This patch fixes that.
It replaces the internal pointer to QSqldatabase with two maps. One maps the
application-database-connection names to unique-database-connection-names.
The second map maps unique-database-connection-names to pointers to QSqldatabase objects.
Also logic was added to to return the correct database-connection as well as
cleanup code when the thread would exit.
@HerikLyma HerikLyma merged commit 54d3c7c into HerikLyma:master Jun 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants