Thursday, February 17, 2011

Isolating a region from transaction

Transaction in .Net is familiar to everyone and almost all the enterprise applications are using transactions. Our application is not an exception to this.But last week we got one error in the application while reading the DB which is related to Transaction .Flow of the system is little bit complicated and there are a bunch of modules involved in between.So it was very difficult to find out what is the root cause for the issue? And on the top of that we need to deliver a build to QA.

Since it was reading the decision was to isolate that area from the transaction context.Here is the snippet for that.

'Code running in the context of main transaction
'''''
Using New TransactionScope(TransactionScopeOption.Suppress)
'Code which run independent of the transaction context
End Using
''Remaining code

No comments: