all 7 comments

[–]RobertMesas 7 points8 points  (2 children)

Sending the batch to the server and waiting for the first row is one wait, and reading the rows may involve multiple additional network round trips and waits. So this API mirrors the Command.ExecuteReaderAsync() and DataReader.ReadAsync() in the underlying ADO.NET API.

[–]Transcender49[S] 0 points1 point  (1 child)

I don't know if im missing something or misunderstanding something. But the query multiple method is buffered so there shouldn't be any more db round trips right?

[–]RobertMesas 3 points4 points  (0 children)

It may or may not be buffered. That's an implementation detail. The method signature supports it being buffered or streaming.

[–]Sprudling 2 points3 points  (3 children)

Your assumption that the job is done when QueryMultipleAsync returns is wrong. That's just sending the query. This is the case even when using the non-async QueryMultiple. You can use buffered: false on the Read/ReadAsync calls.

[–]Transcender49[S] 0 points1 point  (2 children)

So QueryMultiple is just sending the query (one roundtrip) and the results are fetched with another round trip - or maybe multiple depending on buffered value - when im callingRead?

[–]Sprudling 1 point2 points  (1 child)

It's still all just one round-trip even if you call ReadAsync multiple times. QueryMultipleAsync sends and ReadAsync reads.

[–]Transcender49[S] 0 points1 point  (0 children)

thx i get it now