oracle / oracle-r2dbc

R2DBC Driver for Oracle Database
https://oracle.com
Other
197 stars 40 forks source link

Executor Option #51

Closed Michael-A-McMahon closed 3 years ago

Michael-A-McMahon commented 3 years ago

This branch adds an extended Option to configure a non-default Executor for asynchronous tasks that the driver executes. Oracle R2DBC implements support for this Option using Oracle JDBC's Reactive Extensions method: OracleConnectionBuilder.executorOracle(Executor).

This branch also moves all extended Options into a new OracleR2dbcOptions class that is exported to user code. This allows user code to reference a static field when setting an Option, like this:

ConnectionFactoryOptions.builder()
  .option(OracleR2dbcOptions.EXECUTOR, myExecutor)
  .option(OracleR2dbcOptions.TNS_ADMIN, "/path/to/tns/admin")
  ...

Having a static field can be less error prone than having to type a String value with Option.valueOf(String). It also helps readers of the code to identify that the Option is one defined by Oracle R2DBC; This might not be as obvious with a call to Option.valueOf(String).

This branch breaks existing code that used the "oracleNetDescriptor" option The Option has been renamed to "oracle.r2dbc.descriptor". Existing code will have to replace the old name with this new one. Since we are still in version 0.x, we are still breaking stuff (and trying our best to "move fast"). (@razum90, who originally requested support for descriptors. I'm "@"ing you just to be sure you'll see this change coming).

All Oracle R2DBC options going forward should use the "oracle.r2dbc" namespace. This is more consistent with other Java libraries from Oracle, such as Oracle JDBC, which uses the "oracle.jdbc" name space.