Skip to content

Any way to reduce the roundtrip for BeginTransaction and Commit #2976

@ycymio

Description

@ycymio

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 and COMMIT 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Performance 📈Issues that are targeted to performance improvements.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions