Skip to content

Commit

Permalink
Oracle JDBC: to not enforce runtime initializaiton for java.sql.Drive…
Browse files Browse the repository at this point in the history
…rManager
  • Loading branch information
Sanne committed Dec 15, 2021
1 parent ed7ebb6 commit 709d922
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,13 @@ void runtimeInitializeDriver(BuildProducer<RuntimeInitializedClassBuildItem> run
//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"));
runtimeInitialized.produce(new RuntimeInitializedClassBuildItem("java.sql.DriverManager"));

// 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)
// B) It does actually not compile if you have other JDBC drivers, as other implementations need this class initialized during build
// C) This metadata is expected to get improved in the next public release of the Oracle JDBC driver
// runtimeInitialized.produce(new RuntimeInitializedClassBuildItem("java.sql.DriverManager"));

runtimeInitialized.produce(new RuntimeInitializedClassBuildItem("oracle.jdbc.driver.LogicalConnection"));
runtimeInitialized.produce(new RuntimeInitializedClassBuildItem("oracle.jdbc.pool.OraclePooledConnection"));
runtimeInitialized.produce(new RuntimeInitializedClassBuildItem("oracle.jdbc.pool.OracleDataSource"));
Expand Down

0 comments on commit 709d922

Please sign in to comment.