Skip to content

Operator has been terminated issue with RowsFetchSpec and Spring DatabaseClient #133

@sephiroth-j

Description

@sephiroth-j

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();
	}
}

spring-oracle-r2dbc-issue.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions