Replies: 1 comment 1 reply
-
It truly depends on the use-case and the extent of transactions you will be doing with each query. Of course, doing them implicitly within the same query on the server side will give you performance benefits and save extra round trips when calling .NET APIs. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I noticed there is a similar question for Npgsql here, but I am unsure if it also applies to Azure SQL Server.
In our scenario, we call SQL Server to query data twice in one transaction for 99.5% of cases. If we use BeginTransaction() and Commit(), it will require four roundtrips, which nearly doubles the latency in the transaction part.
Are there any concerns if we choose to explicitly set transaction isolation with SNAPSHOT and use
BEGIN TRAN
andCOMMIT TRAN
within CommandText? Additionally, do you have any suggestions or best practices that could help us optimize the performance and reduce latency during these transactions? Any insights from your experience would be greatly appreciated.Beta Was this translation helpful? Give feedback.
All reactions