Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<version>0.4.0</version>
<name>oracle-r2dbc</name>
<description>
Oracle R2DBC Driver implementing version 0.9.0 of the R2DBC SPI for Oracle Database.
Oracle R2DBC Driver implementing version 1.0.0 of the R2DBC SPI for Oracle Database.
</description>
<url>
https://github.com/oracle/oracle-r2dbc
Expand Down Expand Up @@ -65,8 +65,8 @@

<properties>
<java.version>11</java.version>
<ojdbc.version>21.3.0.0</ojdbc.version>
<r2dbc.version>0.9.0.RELEASE</r2dbc.version>
<ojdbc.version>21.5.0.0</ojdbc.version>
<r2dbc.version>1.0.0.RELEASE</r2dbc.version>
<reactor.version>3.3.0.RELEASE</reactor.version>
<reactive-streams.version>1.0.3</reactive-streams.version>
<junit.version>5.7.0</junit.version>
Expand Down
5 changes: 2 additions & 3 deletions src/main/java/oracle/r2dbc/impl/OracleResultImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,8 @@ public <T> Publisher<T> flatMap(
* </p>
*/
@Override
public Publisher<Integer> getRowsUpdated() {
return publishSegments(UpdateCount.class,
updateCount -> Math.toIntExact(updateCount.value()));
public Publisher<Long> getRowsUpdated() {
return publishSegments(UpdateCount.class, UpdateCount::value);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/oracle/r2dbc/impl/OracleStatementImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -1457,7 +1457,7 @@ private JdbcBatch(
*/
@Override
protected Publisher<Void> bind() {
@SuppressWarnings("unchecked")
@SuppressWarnings({"unchecked","rawtypes"})
Publisher<Void>[] bindPublishers = new Publisher[batchSize];
for (int i = 0; i < batchSize; i++) {
bindPublishers[i] = Flux.concat(
Expand Down
16 changes: 0 additions & 16 deletions src/main/java/oracle/r2dbc/impl/ReadablesMetadata.java
Original file line number Diff line number Diff line change
Expand Up @@ -237,22 +237,6 @@ public List<? extends ColumnMetadata> getColumnMetadatas() {
public boolean contains(String columnName) {
return getColumnIndex(columnName) != -1;
}

/**
* {@inheritDoc}
* <p>
* Implements the R2DBC SPI method by returning a view of the column metadata
* objects, with each list entry mapped to {@link ColumnMetadata#getName()}.
* As specified by the SPI method documentation, the returned collection is
* unmodifiable, imposes the same column ordering as the query result, and
* supports case insensitive look ups.
* </p>
*/
@Override
public Collection<String> getColumnNames() {
throw new UnsupportedOperationException(
"This method is deprecated for removal");
}
}

static final class OutParametersMetadataImpl
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -952,7 +952,7 @@ public void testSetAutoCommit() {
"Unexpected value returned by isAutoCommit() before subscribing to"
+ " setAutoCommit(true) publisher");
awaitMany(
List.of(1, 1),
List.of(1L, 1L),
Flux.from(sessionA.createBatch()
.add("INSERT INTO testSetAutoCommit VALUES ('C')")
.add("INSERT INTO testSetAutoCommit VALUES ('C')")
Expand Down
42 changes: 21 additions & 21 deletions src/test/java/oracle/r2dbc/impl/OracleResultImplTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ public void testGetRowsUpdated() {
.toIterable()
.iterator();
Result insertResult0 = insertResults.next();
Publisher<Integer> insertCountPublisher0 =
Publisher<Long> insertCountPublisher0 =
insertResult0.getRowsUpdated();
awaitOne(1, insertCountPublisher0);
awaitOne(1L, insertCountPublisher0);

// Expect IllegalStateException from multiple Result consumptions.
assertThrows(IllegalStateException.class,
Expand All @@ -100,12 +100,12 @@ public void testGetRowsUpdated() {
() -> insertResult0.map((row, metadata) -> "unexpected"));

// Expect update count publisher to support multiple subscribers
awaitOne(1, insertCountPublisher0);
awaitOne(1L, insertCountPublisher0);

Result insertResult1 = insertResults.next();
Publisher<Integer> insertCountPublisher1 =
Publisher<Long> insertCountPublisher1 =
insertResult1.getRowsUpdated();
awaitOne(1, insertCountPublisher1);
awaitOne(1L, insertCountPublisher1);

// Expect IllegalStateException from multiple Result consumptions.
assertThrows(IllegalStateException.class,
Expand All @@ -114,53 +114,53 @@ public void testGetRowsUpdated() {
() -> insertResult1.map((row, metadata) -> "unexpected"));

// Expect update count publisher to support multiple subscribers
awaitOne(1, insertCountPublisher1);
awaitOne(1L, insertCountPublisher1);

// Expect an update count of zero from UPDATE of zero rows
consumeOne(connection.createStatement(
"UPDATE testGetRowsUpdated SET y = 99 WHERE x = 99")
.execute(),
noUpdateResult -> {
Publisher<Integer> noUpdateCountPublisher =
Publisher<Long> noUpdateCountPublisher =
noUpdateResult.getRowsUpdated();
awaitOne(0, noUpdateCountPublisher);
awaitOne(0L, noUpdateCountPublisher);

// Expect IllegalStateException from multiple Result consumptions.
assertThrows(IllegalStateException.class,
() -> noUpdateResult.map((row, metadata) -> "unexpected"));
assertThrows(IllegalStateException.class, noUpdateResult::getRowsUpdated);

// Expect update count publisher to support multiple subscribers
awaitOne(0, noUpdateCountPublisher);
awaitOne(0L, noUpdateCountPublisher);
});

// Expect update count of 2 from UPDATE of 2 rows
consumeOne(connection.createStatement(
"UPDATE testGetRowsUpdated SET y = 2 WHERE x = 0")
.execute(),
updateResult -> {
Publisher<Integer> updateCountPublisher = updateResult.getRowsUpdated();
awaitOne(2, updateCountPublisher);
Publisher<Long> updateCountPublisher = updateResult.getRowsUpdated();
awaitOne(2L, updateCountPublisher);

// Expect IllegalStateException from multiple Result consumptions.
assertThrows(IllegalStateException.class,
() -> updateResult.map((row, metadata) -> "unexpected"));
assertThrows(IllegalStateException.class, updateResult::getRowsUpdated);

// Expect update count publisher to support multiple subscribers
awaitOne(2, updateCountPublisher);
awaitOne(2L, updateCountPublisher);
});

// Expect no update count from SELECT
awaitNone(Mono.from(connection.createStatement(
"SELECT x,y FROM testGetRowsUpdated")
.execute())
.flatMapMany(selectResult -> {
Publisher<Integer> selectCountPublisher =
Publisher<Long> selectCountPublisher =
selectResult.getRowsUpdated();

// Expect update count publisher to support multiple subscribers
Publisher<Integer> result = Flux.concat(
Publisher<Long> result = Flux.concat(
Mono.from(selectCountPublisher).cache(),
Mono.from(selectCountPublisher).cache());

Expand All @@ -178,16 +178,16 @@ public void testGetRowsUpdated() {
.bind("x", 0)
.execute(),
deleteResult -> {
Publisher<Integer> deleteCountPublisher = deleteResult.getRowsUpdated();
awaitOne(2, deleteCountPublisher);
Publisher<Long> deleteCountPublisher = deleteResult.getRowsUpdated();
awaitOne(2L, deleteCountPublisher);

// Expect IllegalStateException from multiple Result consumptions.
assertThrows(IllegalStateException.class,
() -> deleteResult.map((row, metadata) -> "unexpected"));
assertThrows(IllegalStateException.class, deleteResult::getRowsUpdated);

// Expect update count publisher to support multiple subscribers
awaitOne(2, deleteCountPublisher);
awaitOne(2L, deleteCountPublisher);
});
}
finally {
Expand Down Expand Up @@ -473,7 +473,7 @@ public void testFilter() {
// UpdateCount segment to be published by getRowsUpdated
AtomicReference<UpdateCount> unfilteredUpdateCount =
new AtomicReference<>(null);
awaitOne(1, Flux.from(connection.createStatement(
awaitOne(1L, Flux.from(connection.createStatement(
"INSERT INTO testFilter VALUES (1)")
.execute())
.map(result ->
Expand Down Expand Up @@ -529,7 +529,7 @@ public void testFilter() {
.execute())
.block(sqlTimeout());
Result filteredResult = unfilteredResult.filter(segment -> false);
Publisher<Integer> filteredUpdateCounts = filteredResult.getRowsUpdated();
Publisher<Long> filteredUpdateCounts = filteredResult.getRowsUpdated();
assertThrows(
IllegalStateException.class, unfilteredResult::getRowsUpdated);
assertThrows(
Expand All @@ -545,13 +545,13 @@ public void testFilter() {
.block(sqlTimeout());
Result filteredResult2 = unfilteredResult2.filter(segment ->
fail("Unexpected invocation"));
Publisher<Integer> unfilteredUpdateCounts =
Publisher<Long> unfilteredUpdateCounts =
unfilteredResult2.getRowsUpdated();
assertThrows(
IllegalStateException.class, filteredResult2::getRowsUpdated);
assertThrows(
IllegalStateException.class, unfilteredResult2::getRowsUpdated);
awaitOne(1, unfilteredUpdateCounts);
awaitOne(1L, unfilteredUpdateCounts);

// Execute an INSERT that fails, and filter Message type segments.
// Expect the Result to not emit {@code onError} when consumed.
Expand Down
Loading