hello
QUESTION 1: is it true that .NET framework will automatically enlist help from Distributed Transaction Coordinator?
QUESTION 2: There's no "TransactionScopeOption" for IDbTransaction.BeginTransaction?! It's always TransactionScopeOption.New?Code:try { IDbConnection oConn1 = new SqlConnection("Data Source=Server1;Initial Catalog=myDataBase;User Id=myUsername;Password=myPassword;"); IDbConnection oConn2 = new SqlConnection("Data Source=Server2;Initial Catalog=myDataBase;User Id=myUsername;Password=myPassword;"); IDbTransaction oTx1 = oConn1.BeginTransaction(); IDbTransaction oTx2 = oConn2.BeginTransaction(); ... oConn1 db access ... ... oConn2 db access ... oTx2.Commit(); oTx1.Commit(); } catch(Exception ex) { oTx2.Rollback(); oTx1.Rollback(); } finally { ... }
QUESTION 3. How can you join transaction without use of TransactionScope? Is there such thing as joining multiple transaction..?
Code:IDbTransaction oTx = oConn1.BeginTransaction(); oConn2.EnlistTransaction(oTx); oTx.Commit(); // commit commands associated with both connections
Thanks


Reply With Quote