CurtHagenlocher opened a new pull request, #4901: URL: https://github.com/apache/arrow-adbc/pull/4901
## What's changed The ADO.NET wrapper's `AdbcCommand` now uses the asynchronous, cancellable statement methods added in #4895: - **`ExecuteReaderAsync`** passes its `CancellationToken` to `AdbcStatement.ExecuteQueryAsync(CancellationToken)`. Before, the token was checked once up front and then dropped. - **`ExecuteNonQueryAsync`** is now overridden to call `AdbcStatement.ExecuteUpdateAsync(CancellationToken)`. The `DbCommand` default it replaces runs `ExecuteNonQuery` synchronously on the caller's thread and ignores the token once the command has started. - **`Cancel`** now calls `AdbcStatement.Cancel` instead of throwing `NotImplementedException`. As the `DbCommand.Cancel` contract requires, it does nothing if there's nothing to cancel, and it doesn't throw if the driver can't cancel. This is the fourth of several PRs implementing ADBC 1.1. #4884 fixed bugs in the C importer and exporter, #4885 added the 1.1 APIs to the base classes, and #4895 added async methods and cancellation. Wider DuckDB tests come next. ### Compatibility - **Drivers that implement only the synchronous methods** keep working through the base class defaults, which run them on the thread pool. - **Drivers that override the older parameterless `ExecuteQueryAsync()` or `ExecuteUpdateAsync()`** still have those overrides called, because the token overloads forward to them by default. - **`Cancel` no longer throws `NotImplementedException`.** Code that relied on that exception would see a change, but `DbCommand.Cancel` isn't supposed to throw. - **`ExecuteScalarAsync` and `PrepareAsync`** still use the `DbCommand` defaults. `ExecuteScalar` isn't implemented yet, so they're left for a follow-up. ## Testing New and updated tests in `ClientTests`: - **Token passing:** `ExecuteReaderAsync` and `ExecuteNonQueryAsync` pass the caller's token to the statement. - **Sync fallback:** `ExecuteNonQueryAsync` works with a driver that implements only `ExecuteUpdate`. - **Pre-cancelled tokens:** a token that's already cancelled stops `ExecuteNonQueryAsync` before it reaches the statement. - **`Cancel`:** it forwards to the statement, and it doesn't throw when the driver can't cancel. - **Updated mocks:** the existing tests now set up the token overload of `ExecuteQueryAsync`, which the command calls. **Results:** - The full solution builds without warnings, and `dotnet format --verify-no-changes` is clean. - The core test project passes on net10.0, net8.0 and net472. - 10 full runs with `DOTNET_PROCESSOR_COUNT=2` had no failures. 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
