I have some simple code where I am trying to create a WCF transaction. However, I found that even though the 'Complete' method is not called on WCF transaction, it still commits the database data insert. So, data is being saved whether I call Complete method or not on the transactionscope object. Any idea why this is happening?
My code is as below.
private void insertButton_Click(object sender, EventArgs e)
ClientForWCFTran.ServiceReference1.ServiceClient serviceClient = new ClientForWCFTran.ServiceReference1.ServiceClient("WSHttpBinding_IService");
TransactionOptions tOpts = new TransactionOptions();
tOpts.IsolationLevel = System.Transactions.IsolationLevel.RepeatableRead;
tOpts.Timeout = new TimeSpan(0, 5, 0);
using (TransactionScope tx = new TransactionScope(TransactionScopeOption.RequiresNew, tOpts))
serviceClient.InsertPerson(new InsertPersonRequest(firstNameTextBox.Text, middleNameTextBox.Text, lastNameTextBox.Text));
string s1 = null;
//string s2 = s1.Trim();
View Complete Post