I\'m trying to commit/rollback SqlTransaction
in asynchronous. But it look like asynchronous is not supported. Is there any way to make it asynchronous without
With .Net Core 3.0, it is now theoretically doable to commit or rollback asynchronously a transaction, with any transaction deriving from DbTransaction
. So with SqlTransaction
too.
See .Net Core issue #35012. (docs.microsoft.com documentation is currently lagging on this.)
But more important for your concern, so does lag SqlTransaction
underlying implementation: you can call async methods on it, but currently as far as I can see in the source code, they are still delegating to their sync counterparts through DbTransaction default implementation. And this is the case also with Microsoft.Data.SqlClient (no async overrides).
So you can get your code ready to commit or rollback asynchronously with .Net Core 3.0, but you will have to wait a bit more to get them actually async.