msdtc - Distributed Transaction Coordinator -
I am trying to create database transactions (record) in many systems, therefore, I decided to use the system . Transaction Namespace in .net I have configured MSDTC on both systems (but I do not know if I have properly configured). My transactions have two inclusions which will be executed on the local system. Second, a local network will be executed on some other systems. The first insert query works successfully but the second one generates an error such as: message = "transaction is already explicitly or explicitly committed or aborted."
Please help in this case.
Here is my code
using (Transaction Scope txSc = New Transaction Skipping ()) {// vrm = new VolatileRM (); //vrm.SetMemberValue(3); Try ({SqlConnection cn = New SqlConnection (connStr1)} {SqlCommand CMD = cn.CreateCommand (); Cmd.CommandText = "insert empdetail values ('YYY')"; Cn.Open (); Cmd.ExecuteNonQuery (); Cn.Close (); } (SqlConnection cn = Using new SqlConnection (connStr)) {SqlCommand cmd = cn.CreateCommand (); Cmd.CommandText = "Insert Stu Values ('23', 'Sentil')"; Cn.Open (); Cmd.ExecuteNonQuery (); Cn.Close (); } TxSc.Complete (); } Hold (exception e) {txSc.Dispose (); DTC is actually running (on local and remote systems) < Also, check the firewall settings on remote and local machines.
Check this frequently asked question:
Questions related to:
Comments
Post a Comment