Reputation: 3912
I have a transacationScope that surrounds some functions. These functions each do database calls of either inserts or updates.
using (var ts = new TransactionScope(TransactionScopeOption.Required, new TransactionOptions()
{
IsolationLevel =
IsolationLevel.Serializable,
Timeout = new TimeSpan(0, 0, 15, 0)
}))
{
DoStuff(arg!, arg2);
ts.Complete(); //This had to be added to commit the changes for inserts (updates worked), otherwise data was being rolled back
}
With ts.Complete();
inserts and updates are committed to the database, without only updates are. Could someone please explain why?
Upvotes: 3
Views: 1934
Reputation: 1063393
That suggests your updates are not part of the transaction. That could mean:
To confirm: without the Complete, nothing in the transaction is committed
Upvotes: 4