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

Oracle JDBC drivers should not be initialized at runtime #23178

Merged
merged 1 commit into from
Jan 25, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,12 @@ void build(BuildProducer<ReflectiveClassBuildItem> reflectiveClass) {
@BuildStep
void runtimeInitializeDriver(BuildProducer<RuntimeInitializedClassBuildItem> runtimeInitialized) {
//These re-implement all the "--initialize-at-build-time" arguments found in the native-image.properties :
runtimeInitialized.produce(new RuntimeInitializedClassBuildItem("oracle.jdbc.OracleDriver"));
runtimeInitialized.produce(new RuntimeInitializedClassBuildItem("oracle.jdbc.driver.OracleDriver"));

// Override: the original metadata marks the drivers as "runtime initialized" but this makes it incompatible with
// other systems (e.g. DB2 drivers) as it makes them incompatible with the JDK DriverManager integrations:
// the DriverManager will typically (and most likely) need to load all drivers in a different phase.
// runtimeInitialized.produce(new RuntimeInitializedClassBuildItem("oracle.jdbc.OracleDriver"));
// runtimeInitialized.produce(new RuntimeInitializedClassBuildItem("oracle.jdbc.driver.OracleDriver"));

// The Oracle driver's metadata hints to require java.sql.DriverManager to be initialized at runtime, but:
// A) I disagree with the fact that a driver makes changes outside of its scope (java.sql in this case)
Expand Down