-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DROID opens multiple connection pools to the same database. #362
Comments
I'm working on how to fix this. Everything still works, so there's no massive issue here, but it would be nice to clean this up. |
Main classes are |
@nishihatapalmer It's probably a Spring scope thing. If we set the Spring scope to |
@adamretter I think there's only one factory, but it creates a new DerbyPooledDataSource for each object that wants a data source. |
brilliant, thanks Matt for looking into this! |
I've created a PR that fixes this issue (in that we only create one connection pool per profile). See the PR for some additional comments. |
Hi all my friends, I think it can be fixed here : Mark it as singleton. It should create only one DB pool per application context. Not as @adamretter mentioned per JVM. I'm not sure at the moment how this work when you have hierarchy of application contexts. Each should be separate application context, but they should inherit from master application context. |
Yep, that works :) Many thanks Radek! |
I also misunderstood @adamretter 's suggestion to mark it as a singleton. I thought we were talking about a single factory, rather than a single output from the factory. Thanks Adam. |
When DROID starts, it opens multiple connection pools to the same database. This can be seen in the logs when it starts, the
HikariPool
is initialised multiple times. This is slow and unnecessary.I've traced why this happens in the git history.
The net result is that all the things that just need an occasional database connection now get a connection pool to themselves (and try to reload the database driver).
The text was updated successfully, but these errors were encountered: