Enterprise Transaction Services—Automatic Transactions
| CSharp-Online.NET:Articles |
| .NET Articles |
| © 2005 Pearson Education, Inc. |
Automatic Transactions
With automatic transactions, you do not have to pass a transaction as an argument of a method; instead, a transaction flows automatically with the context. Using transaction attributes, you can specify whether a transaction is needed.
Using the class attribute [Transaction], you can specify whether objects of the
class are aware of transactions, and whether transactions should be created automatically
by the Enterprise Services runtime.
The class attribute is applied to the class of the serviced component, as shown in this code segment:
[Transaction(TransactionOption.Required)] public class CustomerDataComponent : ServicedComponent {
|

