Skip to content

Commit 8115cc1

Browse files
Supporting Option for OOB connection property
1 parent ef6d84e commit 8115cc1

File tree

1 file changed

+20
-9
lines changed

1 file changed

+20
-9
lines changed

src/main/java/oracle/r2dbc/impl/OracleReactiveJdbcAdapter.java

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,17 @@ final class OracleReactiveJdbcAdapter implements ReactiveJdbcAdapter {
197197
// LOB values. A non-default size may be configured when LOB values are
198198
// too large to be prefetched and must be streamed from Blob/Clob objects.
199199
Option.valueOf(
200-
OracleConnection.CONNECTION_PROPERTY_DEFAULT_LOB_PREFETCH_SIZE)
200+
OracleConnection.CONNECTION_PROPERTY_DEFAULT_LOB_PREFETCH_SIZE),
201+
202+
// Allow out-of-band (OOB) breaks to be enabled. Oracle JDBC uses OOB
203+
// breaks to interrupt a SQL call after a timeout expires. OOB is
204+
// disabled by default to support databases older than 19.x which are
205+
// running on systems that don't support OOB. Starting in 19.x, the
206+
// database automatically checks if it is running on a system that
207+
// supports OOB, and will disable OOB if it's not supported. This option
208+
// can be set to "true" when connecting to database versions 19.x or newer.
209+
Option.valueOf(
210+
OracleConnection.CONNECTION_PROPERTY_THIN_NET_DISABLE_OUT_OF_BAND_BREAK)
201211

202212
);
203213

@@ -389,8 +399,7 @@ public DataSource createDataSource(ConnectionFactoryOptions options) {
389399
OracleDataSource oracleDataSource =
390400
fromJdbc(oracle.jdbc.pool.OracleDataSource::new);
391401

392-
runJdbc(() ->
393-
oracleDataSource.setURL(composeJdbcUrl(options)));
402+
runJdbc(() -> oracleDataSource.setURL(composeJdbcUrl(options)));
394403
configureStandardOptions(oracleDataSource, options);
395404
configureExtendedOptions(oracleDataSource, options);
396405
configureJdbcDefaults(oracleDataSource);
@@ -585,8 +594,10 @@ else if (value instanceof String) {
585594

586595
/**
587596
* Configures an {@code oracleDataSource} with any connection properties that
588-
* this adapter requires by default.
589-
* @param oracleDataSource An data source to configure
597+
* this adapter requires by default. This method will not set a default
598+
* value for any connection property that has already been configured on the
599+
* {@code oracleDataSource}.
600+
* @param oracleDataSource A data source to configure
590601
*/
591602
private static void configureJdbcDefaults(OracleDataSource oracleDataSource) {
592603

@@ -624,10 +635,10 @@ private static void configureJdbcDefaults(OracleDataSource oracleDataSource) {
624635
OracleConnection.CONNECTION_PROPERTY_DEFAULT_LOB_PREFETCH_SIZE,
625636
"1048576");
626637

627-
// Disable out-of-band breaks. JDBC sends one of these when a statement
628-
// timeout expires. When enabled, the database doesn't seem to respond by
629-
// cancelling the statement execution. Disable this so that statement
630-
// timeouts will work correctly.
638+
// Disable out-of-band breaks by default in case the database version is
639+
// 18.x. See the comment above, in the set of
640+
// SUPPORTED_CONNECTION_PROPERTY_OPTIONS, for details. The default setting
641+
// can be "false" once the 18.x database is no longer supported.
631642
setPropertyIfAbsent(oracleDataSource,
632643
OracleConnection.CONNECTION_PROPERTY_THIN_NET_DISABLE_OUT_OF_BAND_BREAK,
633644
"true");

0 commit comments

Comments
 (0)