一聚教程网:一个值得你收藏的教程网站

最新下载

热门教程

.net中的事务处理(二)

时间:2008-01-12 编辑:简简单单 来源:一聚教程网

MSMQ manual transactions
The .NET Framework supports MSMQ transactions in two different ways: manually (internally) by allowing multiple messages to be sent or received as part of a transaction and automatically (externally) by participating in Distributed Transaction Coordinator (DTC) transactions.
MSMQ manual transactions are supported through the MessageQueueTransaction class and are handled entirely inside the MSMQ engine. Please refer to Duncan Mackenzie's article, Reliable Messaging with MSMQ and .NET, for details.
Automatic Transactions
The .NET Framework relies on MTS/COM+ services to support automatic transactions. COM+ uses the Microsoft Distributed Transaction Coordinator (DTC) as a transaction manager and a transaction coordinator to run transactions in a distributed environment. This enables a .NET application to run a transaction that combines diverse activities across multiple resources such as inserting an order into a SQL Server database, writing a message to a Microsoft Message Queue (MSMQ) queue, sending an e-mail message, and retrieving data from an Oracle database.
By providing a programming model based on declarative transactions, COM+ makes it very simple for your application to run transactions that span heterogeneous resources. The caveat is that it pays a performance penalty due to DTC and COM interoperability overhead and there is no support for nested transactions.
ASP.NET pages, Web Service methods, and .NET classes can be marked to be transactional by setting a declarative transaction attribute.
ASP.NET

热门栏目