We are currently using dapper to handle very expensive update / deletion scripts, and we are very pleased with that.
Now we have the following scenario that I want to speed up.
- Update 1 takes about 60 seconds.
- Update 2 takes less than 1 second.
If we do this as synchronization, we will spend a total of about 61 seconds. Can we speed this up to trigger the first update using the method ExecuteAsync, but don't expect it. For instance:
Connection.ExecuteAsync("Update 1", new { someValue }, Transaction, 120);
Connection.Execute("Update 2", new { someValue }, Transaction);
Note the lack of a keyword await.
This will speed up the process, but it's a good idea, and will it work in a transaction? What happens when a transaction commit is committed and the first update is still in progress? Or is it a bad idea to use ExecuteAsync without waiting?
Assuming Update 2 is independent of Update 1.
source
share