PetaPoco icon indicating copy to clipboard operation
PetaPoco copied to clipboard

Cancellation Token support for Async transaction methods

Open dje1990 opened this issue 3 years ago • 1 comments

Hi, Regarding in the class Database.cs the methods BeginTransactionAsync(), AbortTransactionAsync() and CompleteTransactionAsync(). Thank for you implementing these methods. Is it possible to pass through a cancellationToken to the underlying DbConnection methods? BeginTransactionAsync() already has an overload that takes a cancellationToken as a parameter, but the method does not pass this cancellationToken to DbTransaction.BeginTransactionAsync(). AbortTransactionAsync() and CompleteTransactionAsync() do not have overloads that take a cancellationToken as a parameter, but could pass one to CleanupTransactionAsync(), which could then pass the cancellationToken to DbTransaction.CommitAsync() and DbTransaction.RollbackAsync().

Thanks for your help.

Related to: https://github.com/CollaboratingPlatypus/PetaPoco/pull/629 https://github.com/CollaboratingPlatypus/PetaPoco/issues/628

dje1990 avatar Mar 31 '22 22:03 dje1990

I noticed the same thing when working on the doc comments; check the branch for #682 and you'll see I added inline to-do comments and put it on the list of fixes for once that PR is merged.

Ste1io avatar Sep 28 '23 02:09 Ste1io