-
Notifications
You must be signed in to change notification settings - Fork 36
Open
Description
Describe the bug
When using r2dbc-mssql
to call a stored procedure that returns multiple rows, the result never completes — the Flux
hangs indefinitely unless a .timeout(...)
is applied. No rows are emitted, and .doOnComplete()
is never called.
This only happens with stored procedures that return full result sets. Simple procedures with SELECT TOP 1
or no result sets work fine.
Environment
- r2dbc-mssql version: [your version]
- SQL Server version: [e.g., SQL Server 2019]
- Java version: [e.g., OpenJDK 17]
- Spring Boot version: [if applicable]
Reproduction Steps
- Create a stored procedure like:
CREATE PROCEDURE GET_ALL_DATA
AS
BEGIN
SET NOCOUNT ON;
SELECT * FROM SomeTable; -- Returns many rows
END
2. Call it via DatabaseClient:
databaseClient
.sql("EXEC GET_ALL_DATA")
.map((row, meta) -> ...) // any valid mapper
.all()
.doOnComplete(() -> System.out.println("done"))
.doOnError(e -> e.printStackTrace())
.subscribe();
Result: Nothing happens. No rows. No errors. No completion. Just hangs.
If the procedure returns a single row (e.g., SELECT TOP 1), it completes normally.
Expected behavior
Procedure result set should be emitted and completed properly, like a normal SELECT.
Workaround
Calling the same logic via raw SELECT (instead of procedure) works fine:
databaseClient
.sql("SELECT * FROM SomeTable")
.map(...)
.all();
Notes
This behavior suggests a protocol parsing or result handling bug in the driver when dealing with full result sets from stored procedures.
Metadata
Metadata
Assignees
Labels
No labels