DISTRIBUTED TRANSACTION: DTC in SQL server

There is two SQL servers and DTC is enabled both of them.

One SQL server is local and another one is a linked server named test.

Run a Distributed Transaction in SQL server for test purpose:

after running the T-SQL transaction you can check in the DTC report.

 

you can check the DTC connection and firewall settings:

DTC ping tool

In powershell:

If the remote server is another domain,  you will get an error:
New-CimSession : WinRM cannot process the request. The following error with errorcode 0x80090322 occurred while using Kerberos authentication: An unknown security error occurred.

In this case you can set: No Authentication Required.

 

DTC and Java

How to enable DTC in SQL server for Java:

– copy sqljdbc_xa.dll to sql server binn folder from the EXTRACTED (but not installed) jdbc driver
– enable xa transactions in component services > computerts > Distributed Transaction Coordinator > Local DTC (properties, security tab) Enable XA transactions
– restart sql server (all components to be sure)
– run script on master db. (xa_install.sql it is also in the jdbc driver, next to the .sql)
– the user that will perform distributed transactions must have the role “SqlJDBCXAUser” set on the MASTER db!