transaction scope

  • Thread starter Thread starter Smokey Grindel
  • Start date Start date
S

Smokey Grindel

If I am inside a function that returns a boolean and i have all the commands
inside it inside a transaction scope and I do something like a return false,
which causes it to never run the trancastion scope's complete method, this
does cancel out the transaction right? causeing it to rollback? thanks!
 
using (TransactionScope ts = new TransactionScope())
{
//call complete on the TransactionScope or not based on return value
if(someFunc())
ts.Complete(); // Commit the transaction
}


if someFunc() reutrns false - the transaction will rollback because you are
exiting the scope without calling ts.Complete();
 
Smokey,

Yea there can be "something", however without showing code you are the only
one who can fix that.

Cor
 
I am confused about what you said, I was just asking how the thing worked,
there is no code to fix
 
Back
Top