-
Notifications
You must be signed in to change notification settings - Fork 44
Closed
Description
When a mapping function via map is used on a GenericExecuteSpec, the onErrorDropped hook is triggered twice and the following error is logged. This does not happen when fetch is used with its default row mapper that maps the result to a Map<String,Object>. The query is successfully executed in both cases.
Error
2023-09-19T11:00:49.267+02:00 ERROR 4268 --- [onPool-worker-1] reactor.core.publisher.Operators : Operator called default onErrorDropped
reactor.core.Exceptions$StaticThrowable: Operator has been terminated
2023-09-19T11:00:49.271+02:00 ERROR 4268 --- [onPool-worker-1] reactor.core.publisher.Operators : Operator called default onErrorDropped
reactor.core.Exceptions$StaticThrowable: Operator has been terminated
Example
@DataR2dbcTest(properties =
{
"spring.r2dbc.url=r2dbc:oracle://testdb",
"spring.r2dbc.username=sa",
"spring.r2dbc.password=sa",
})
class DatabaseClientTest
{
@Autowired
private DatabaseClient dbClient;
@Test
void testMethod()
{
dbClient.sql("select '1234' value from dual")
.map(readable -> readable.get(0, String.class)).first()// onErrorDropped: Operator has been terminated
// .fetch().one().map(row -> row.get("value")).cast(String.class)// no onErrorDropped
.as(StepVerifier::create)
.expectNext("1234")
.verifyComplete();
}
}Metadata
Metadata
Assignees
Labels
No labels