Skip to content

Commit 55c6c54

Browse files
Leave OOB enabled by default
1 parent 8115cc1 commit 55c6c54

File tree

4 files changed

+21
-18
lines changed

4 files changed

+21
-18
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,9 @@ Options. For Options having any of the following names, a CharSequence value may
174174
- [oracle.jdbc.fanEnabled](https://docs.oracle.com/en/database/oracle/oracle-database/21/jajdb/oracle/jdbc/OracleConnection.html?is-external=true#CONNECTION_PROPERTY_FAN_ENABLED)
175175
- [oracle.jdbc.implicitStatementCacheSize](https://docs.oracle.com/en/database/oracle/oracle-database/21/jajdb/oracle/jdbc/OracleConnection.html?is-external=true#CONNECTION_PROPERTY_IMPLICIT_STATEMENT_CACHE_SIZE)
176176
- [oracle.jdbc.defaultLobPrefetchSize](https://docs.oracle.com/en/database/oracle/oracle-database/21/jajdb/oracle/jdbc/OracleConnection.html?is-external=true#CONNECTION_PROPERTY_DEFAULT_LOB_PREFETCH_SIZE)
177+
- [oracle.net.disableOob](https://docs.oracle.com/en/database/oracle/oracle-database/21/jajdb/oracle/jdbc/OracleConnection.html?is-external=true#CONNECTION_PROPERTY_THIN_NET_DISABLE_OUT_OF_BAND_BREAK)
178+
- Out of band (oob) breaks effect statement timeouts. Set this to "true"
179+
if statement timeouts are not working correctly.
177180
- Oracle Net Descriptors of the form ```(DESCRIPTION=...)``` may be specified as an io.r2dbc.spi.Option having the name `oracleNetDescriptor`.
178181
- If `oracleNetDescriptor` is specified, then it is invalid to specify any other options that might conflict with information in the descriptor, such as: `HOST`, `PORT`, `DATABASE`, and `SSL`.
179182
- The `oracleNetDescriptor` option may appear in the query section of an R2DBC URL: `r2dbc:oracle://?oracleNetDescriptor=(DESCRIPTION=...)`

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

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -199,13 +199,12 @@ final class OracleReactiveJdbcAdapter implements ReactiveJdbcAdapter {
199199
Option.valueOf(
200200
OracleConnection.CONNECTION_PROPERTY_DEFAULT_LOB_PREFETCH_SIZE),
201201

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.
202+
// Allow out-of-band (OOB) breaks to be disabled. Oracle JDBC uses OOB
203+
// breaks to interrupt a SQL call after a timeout expires. This option
204+
// may need to be disabled when connecting to an 18.x database. Starting
205+
// in 19.x, the database can detect when it's running on a system where
206+
// OOB is not supported and automatically disable OOB. This automated
207+
// detection is not impleneted in 18.x.
209208
Option.valueOf(
210209
OracleConnection.CONNECTION_PROPERTY_THIN_NET_DISABLE_OUT_OF_BAND_BREAK)
211210

@@ -635,14 +634,6 @@ private static void configureJdbcDefaults(OracleDataSource oracleDataSource) {
635634
OracleConnection.CONNECTION_PROPERTY_DEFAULT_LOB_PREFETCH_SIZE,
636635
"1048576");
637636

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.
642-
setPropertyIfAbsent(oracleDataSource,
643-
OracleConnection.CONNECTION_PROPERTY_THIN_NET_DISABLE_OUT_OF_BAND_BREAK,
644-
"true");
645-
646637
// TODO: Disable the result set cache? This is needed to support the
647638
// SERIALIZABLE isolation level, which requires result set caching to be
648639
// disabled.

src/test/java/oracle/r2dbc/impl/OracleReactiveJdbcAdapterTest.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,6 @@ public void testCreateDataSource() throws SQLException {
104104
defaultProperties.setProperty(
105105
OracleConnection.CONNECTION_PROPERTY_DEFAULT_LOB_PREFETCH_SIZE,
106106
"1048576");
107-
defaultProperties.setProperty(
108-
OracleConnection.CONNECTION_PROPERTY_THIN_NET_DISABLE_OUT_OF_BAND_BREAK,
109-
"true");
110107

111108
// Expect only default connection properties when no extended
112109
// options are supplied
@@ -367,6 +364,10 @@ public void testStatementTimeout() {
367364
.option(USER, user())
368365
.option(PASSWORD, password())
369366
.option(STATEMENT_TIMEOUT, Duration.ofSeconds(2))
367+
// Disable OOB to support testing with an 18.x database
368+
.option(Option.valueOf(
369+
OracleConnection.CONNECTION_PROPERTY_THIN_NET_DISABLE_OUT_OF_BAND_BREAK),
370+
"true")
370371
.build())
371372
.create())
372373
.block(connectTimeout());

src/test/java/oracle/r2dbc/test/DatabaseConfig.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,14 @@ public static void showErrors(Connection connection) {
248248
.option(Option.valueOf(
249249
OracleConnection.CONNECTION_PROPERTY_IMPLICIT_STATEMENT_CACHE_SIZE),
250250
0)
251+
// Disable out-of-band breaks to support testing with the 18.x
252+
// database. The 19.x database will automatically detect when it's
253+
// running on a system where OOB is not supported, but the 18.x
254+
// database does not do this and so statement timeout tests will
255+
// hang if the database system does not support OOB
256+
.option(Option.valueOf(
257+
OracleConnection.CONNECTION_PROPERTY_THIN_NET_DISABLE_OUT_OF_BAND_BREAK),
258+
"true")
251259
.build());
252260

253261
SHARED_CONNECTION_FACTORY = new SharedConnectionFactory(

0 commit comments

Comments
 (0)