Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TransactionScope and "durable resources"

Quick question about the TransactionScope object. Found this on the internet:

When you access your first durable resource manager, a lightweight committable transaction is created to support the single transaction. When you access a second durable resource manager, the transaction is promoted to a distributed transaction.

That seems fine, but I didnt understand what exactly is a "durable resource". I know that TransactionScope only works with SQL Server 2005 and above so if I need to access SQL server 200, it wont be possible? How about a text file on the disk? I've always heard that you cant have transaction control when it involves disk access. Maybe is it different with this object?

Thanks!

like image 693
Diego Avatar asked Jan 31 '12 13:01

Diego


People also ask

What is TransactionScope?

The TransactionScope class provides a simple way to mark a block of code as participating in a transaction, without requiring you to interact with the transaction itself. A transaction scope can select and manage the ambient transaction automatically.

What is TransactionScope in asp net?

TransactionScope is a class of System Namespace. It can also be termed as Transactions Namespace. The TransactionScope class supports transactions from code blocks and that is why it plays a key role in the . NET development framework. This class usually manages local as well as distributed transactions from our code.

What is escalated transaction?

Transaction management escalation describes the process of migrating a transaction from one of the transaction manager's components to another. System. Transactions includes a transaction manager component that coordinates a transaction involving at most, a single durable resource or multiple volatile resources.


2 Answers

This link discusses the differences between durable and volatile resource managers.

Just to clarify - TransactionScopes will work with earlier versions of SQL, however, the lightweight transaction manager only works for 2005+. DTC will be required for transactions to SQL 2000.

There is also support for transactional file systems (Vista and later) - have a look here.

like image 86
StuartLC Avatar answered Sep 18 '22 01:09

StuartLC


Resource Managers are of two types

  • Durable: transactions are durable even when system failures occur.Resource Managers memorize state of a transaction. If system is shut down in between then upon restart Transaction can proceed from its previous state. for e.g. SQL Server DBMS and MSMQ.
  • Volatile: Non-resistant to system failures, e.g. This transactional implementation of some core .Net classes.
like image 42
Abhijeet Nagre Avatar answered Sep 20 '22 01:09

Abhijeet Nagre