E543 Upgrade class: provide alternate way to load the old H2 driver by habbit-baggins · Pull Request #4211 · h2database/h2database · GitHub
[go: up one dir, main page]

Skip to content

Conversation

habbit-baggins
Copy link

Fix #3470 by providing an alternate way to provision the old driver for the upgrade procedure.

The Upgrade.upgrade and Upgrade.loadH2 functions get new overloads allowing a ClassLoader for the old driver JAR to be passed. Currently the user has to pass the old version number and the code calls Maven to download the corresponding JAR, but this may be problematic in certain environments as described in the original issue.

For example, if using H2 from an OSGi environment, users can now load the corresponding bundle and pass the ClassLoader to the new overload of upgrade.

TODO: I would also like to add relevant code to TestUpgrade, but I am unfamiliar with the custom testing framework used in the project. I will keep thinking about it, but in the meantime the changes to the main codebase can be reviewed.

Fixes h2database#3470, removing the forced reliance on either Maven or its directory structure.
@habbit-baggins habbit-baggins changed the title Provide alternate way to load the old H2 driver Upgrade class: provide alternate way to load the old H2 driver Mar 17, 2025
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.

Upgrade class should not require the JAR to be placed in the default location for a Maven repository.

1 participant

0