Quantcast
Channel: .NET Framework Class Libraries forum
Viewing all articles
Browse latest Browse all 8156

TransactionScope

$
0
0

hi experts, I got a wired problem need your help. I have nested transactions. The outer method calls an inner method SaveChangesToSource that opens another transaction scope. Actually I know my underlying sql may have problem. What I cannot understand is why my inner transaction complete successfully and it looks like the exception is been postponed until I call outer cope.Complete??it's like the inner transaction does not report error until you call outer scope.complete.. then the the outer scope rollback the whole thing...??

using (TransactionScope scope =newTransactionScope()){SaveChangesToSource(changes);
      scope.Complete();}protectedoverridevoidSaveChangesToSource(IEnumerable<IChange> changes){
    using (TransactionScope scope =newTransactionScope()){
         _bl.SaveChanges(changes);
         scope.Complete();}}

Viewing all articles
Browse latest Browse all 8156

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>