Skip to content

Make distributed transactions code trimmable (on Windows) #76791

Open

Description

@roji

The way that System.Transactions is currently factored makes it impossible to trim the distributed transactions code when it's not used (note that this affects Windows only, other platforms don't have this code). Some initial work was done in 7.0 by @teo-tsirpanis (thanks!), see #76376 (comment) and below - but the bulk of the code remains untrimmable.

This could be done by refactoring all distributed transactions code into an implementation of an interface (these are currently called DtcTransactionConnector and ITransactionConnector respectively), so that instead of static calls directly to distributed transaction code, we go through a static member which have the interface type. That member is only set to the implementation when the TransactionManager.ImplicitDistributedTransactions flag is set, so when it's not set, the implementation (and all its dependencies) can be trimmed.

/cc @teo-tsirpanis @jkotas @ajcvickers

Activity

  1. added
    linkable-framework
    on Oct 9, 2022
  2. added this to the 8.0.0 milestone on Oct 9, 2022
  3. self-assigned this
    on Oct 9, 2022
  4. modified the milestones: 8.0.0, Future on Jun 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-System.Transactionslinkable-framework

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions