Skip to content

Commit bae1154

Browse files
Merge pull request #41 from oracle/spi-0-9-0-M2
0.9.0.M2 SPI Update
2 parents 8ad9e14 + 55c6c54 commit bae1154

31 files changed

+2824
-2227
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=...)`

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
<version>0.2.0</version>
3030
<name>oracle-r2dbc</name>
3131
<description>
32-
Oracle R2DBC Driver implementing version 0.9.0.M1 of the R2DBC SPI for Oracle Database.
32+
Oracle R2DBC Driver implementing version 0.9.0.M2 of the R2DBC SPI for Oracle Database.
3333
</description>
3434
<url>
3535
https://github.com/oracle/oracle-r2dbc
@@ -66,7 +66,7 @@
6666
<properties>
6767
<java.version>11</java.version>
6868
<ojdbc.version>21.1.0.0</ojdbc.version>
69-
<r2dbc.version>0.9.0.M1</r2dbc.version>
69+
<r2dbc.version>0.9.0.M2</r2dbc.version>
7070
<reactor.version>3.3.0.RELEASE</reactor.version>
7171
<reactive-streams.version>1.0.3</reactive-streams.version>
7272
<junit.version>5.7.0</junit.version>

src/main/java/oracle/r2dbc/OracleR2dbcTypes.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ private OracleR2dbcTypes() {}
6161
public static final Type INTERVAL_YEAR_TO_MONTH =
6262
new TypeImpl(Period.class, "INTERVAL YEAR TO MONTH");
6363

64+
/**
65+
* Stores a JSON value.
66+
*/
6467
public static final Type JSON =
6568
new TypeImpl(OracleJsonObject.class, "JSON");
6669

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

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
package oracle.r2dbc.impl;
2323

2424
import java.sql.Connection;
25+
import java.time.Duration;
2526
import java.util.LinkedList;
2627
import java.util.Queue;
2728
import java.util.concurrent.atomic.AtomicReference;
@@ -62,6 +63,11 @@ final class OracleBatchImpl implements Batch {
6263
*/
6364
private final Connection jdbcConnection;
6465

66+
/**
67+
* Timeout applied to each statement this {@code Batch} executes;
68+
*/
69+
private final Duration timeout;
70+
6571
/**
6672
* Ordered sequence of SQL commands that have been added to this batch. May
6773
* be empty.
@@ -71,14 +77,17 @@ final class OracleBatchImpl implements Batch {
7177
/**
7278
* Constructs a new batch that uses the specified {@code adapter} to execute
7379
* SQL statements with a {@code jdbcConnection}.
74-
* @param adapter Adapts JDBC calls into reactive streams.
75-
* @param jdbcConnection JDBC connection to an Oracle Database.
80+
* @param timeout Timeout applied to each statement this batch executes.
81+
* Not null. Not negative.
82+
* @param jdbcConnection JDBC connection to an Oracle Database. Not null.
83+
* @param adapter Adapts JDBC calls into reactive streams. Not null.
7684
*/
7785
OracleBatchImpl(
78-
ReactiveJdbcAdapter adapter, java.sql.Connection jdbcConnection) {
79-
this.adapter = requireNonNull(adapter, "adapter is null");
86+
Duration timeout, Connection jdbcConnection, ReactiveJdbcAdapter adapter) {
87+
this.timeout = timeout;
8088
this.jdbcConnection =
8189
requireNonNull(jdbcConnection, "jdbcConnection is null");
90+
this.adapter = requireNonNull(adapter, "adapter is null");
8291
}
8392

8493
/**
@@ -92,7 +101,8 @@ final class OracleBatchImpl implements Batch {
92101
public Batch add(String sql) {
93102
requireOpenConnection(jdbcConnection);
94103
requireNonNull(sql, "sql is null");
95-
statements.add(new OracleStatementImpl(adapter, jdbcConnection, sql));
104+
statements.add(
105+
new OracleStatementImpl(sql, timeout, jdbcConnection, adapter));
96106
return this;
97107
}
98108

0 commit comments

Comments
 (0)