SQL Server Distributed Transactions: xp_sqljdbc_xa_commit vs xp_sqljdbc_xa_end In SQL Server 2019, can anyone definitively tell me the functional difference between xp_sqljdbc_xa_commit &amp; xp_sqljdbc_xa_end?
My guess is that commit is attempting to commit the transaction (thank you Mr. Obvious ;-) ) and end is telling DTC &quot;hey, all done here. Please clean up.&quot;
But, the code appears to live in SQLJDBC_XA.dll (as extended sp) so I can't view it, and I can't find a good reference to confirm my assumptions.
Thanks!
The SQL Server JDBC Driver's source code on GitHub is a great place to track this down.
@Override
public void end(Xid xid, int flags) throws XAException {
    // Called by the transaction mgr after the app closes the connection it was given from this physical
    // connection
    /*
     * Ends the work performed on behalf of a transaction branch. The resource manager disassociates the XA resource
     * from the transaction branch specified and let the transaction be completed. If TMSUSPEND is specified in
     * flags, the transaction branch is temporarily suspended in incomplete state. The transaction context is in
     * suspened state and must be resumed via start with TMRESUME specified. If TMFAIL is specified, the portion of
     * work has failed. The resource manager may mark the transaction as rollback-only. If TMSUCCESS is specified,
     * the portion of work has completed successfully.
     */
    DTC_XA_Interface(XA_END, xid, flags | tightlyCoupled);
}

src/main/java/com/microsoft/sqlserver/jdbc/SQLServerXAResource.java
So it's used by SQL Server's implementation of the XAResource interface.
For background see How It Works: SQL Server DTC (MSDTC and XA Transactions)