Skip to content
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

Do not create connection pools for upgrades #2232

Merged
merged 1 commit into from
Dec 11, 2022

Conversation

nscuro
Copy link
Member

@nscuro nscuro commented Dec 4, 2022

Description

By creating a temporary PMF based on the same properties as the PersistenceFactoryInitializer, the UpgradeInitializer would create two connection pools of 10 (per default) connections each, for the duration of its execution.

Because upgrades are executed in serial, connection pooling is not beneficial. Creating temporary connection pools is a wasteful operation and should be avoided.

Addressed Issue

Partially addresses #1935

Additional Details

Checklist

  • I have read and understand the contributing guidelines
  • This PR fixes a defect, and I have provided tests to verify that the fix is effective
  • This PR implements an enhancement, and I have provided tests to verify that it works as intended
  • This PR introduces changes to the database model, and I have added corresponding update logic
  • This PR introduces new or alters existing behavior, and I have updated the documentation accordingly

@nscuro nscuro changed the title Do not create dedicated connection pool for upgrades Do not create connection pools for upgrades Dec 4, 2022
By creating a temporary PMF based on the same properties as the `PersistenceFactoryInitializer`, the `UpgradeInitializer` would create *two* connection pools of `10` (per default) connections each, for the duration of its execution.

Because upgrades are executed in serial, connection pooling is not beneficial. Creating temporary connection pools is a wasteful operation and should be avoided.

Partially addresses DependencyTrack#1935

Signed-off-by: nscuro <nscuro@protonmail.com>
@nscuro nscuro added this to the 4.7 milestone Dec 11, 2022
@nscuro nscuro added the enhancement New feature or request label Dec 11, 2022
@nscuro nscuro merged commit 4e3023c into DependencyTrack:master Dec 11, 2022
@nscuro nscuro deleted the issue-1935 branch December 11, 2022 17:03
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant