Click here to Skip to main content
15,792,870 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Friends,

I have used TransactionScope class for transaction handling in ASP.NET
but some times it works as partially commit.

Can any one tell me why and how to resolve this issue ?

I was googling, but got no satisfying solution.

Please help me

1 solution

Refer - [MSDN] Transaction Scope[^].
Limitations of System.Transactions

The System.Transactions namespace is not supported by .NET Compact Framework 2.0. Therefore, implementation will be for the Windows desktop operating system only and will correspond with the .NET Framework 2.0, .NET Framework 3.0, .NET Framework 3.5 or .NET Framework 4.

Note that if there is a timeout, the System.Transactions infrastructure will call Rollback from a separate thread. The main thread will not know about a rollback occurring in the separate thread. The long transactions might see a non-deterministic behavior and partial commit scenarios. To resolve this, increase the timespan of the transaction scope object when you create the object.

You can use any constructor listed here - [MSDN] TransactionScope Constructor[^] for the same.
Share this answer
shreeniwas kushwah 28-May-13 2:56am    
So which class i should use for transaction Handling for Web Apps ??
Use this TransactionScope class, but use different constructor which includes a TimeSpan parameter.
So, you can increase the TimeSpan while declaring the object.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900