Automatic Transactions

Microsoft Transaction Server (MTS), COM+, and the common language runtime all support the same automatic distributed transaction model.

After an ASP.NET page, XML Web service method, or .NET Framework class is marked to participate in a transaction, it will automatically execute within the scope of a transaction. You can control an object's transactional behavior by setting a transaction attribute value on a page,in an XML Web service method, or in a class. The attribute value, in turn, determines the transactional behavior of the instantiated object. Thus, based on the declared attribute value, an object will automatically participate in an existing or ongoing transaction, be the root of a new transaction, or never participate in a transaction at all. The syntax to declare the transaction attribute varies slightly in a .NET Framework class, an ASP.NET page, and an XML Web service method.

The declarative transaction attribute specifies how an object participates in a transaction, and is configured programmatically. Although this declarative level represents the logic of a transaction, it is one step removed from the physical transaction. A physical transaction occurs when a transactional object accesses a data resource, such as a database or message queue. The transaction associated with the object automatically flows to the appropriate resource manager. An associated driver, such as OLE DB, Open Database Connectivity (ODBC), or ActiveX Data Objects (ADO), looks up the transaction in the object's context and enlists in the transaction through the Distributed Transaction Coordinator (DTC). The entire physical transaction occurs automatically.

The topics that follow describe support for automatic transactions.

See Also

Transaction Models | Automatic Transactions and ASP.NET | Automatic Transactions and XML Web Services | Automatic Transactions and .NET Framework Classes | Voting in an Automatic Transaction