??™??™
The recommendation for using transactions is to implicitly create transactions using the Transaction-
Scope class. The benefit of implicitly creating them is that the encompassing transaction context is
automatically managed. This is typically called an ambient transaction, and is defined as the transaction
in which your code is currently executing.
What is cool about using the TransactionScope is that the transaction manager determines the type of
transaction to use. The decision is based on two things: whether there is an existing transaction, and the
value of the TransactionScopeOption parameter in the TransactionScope constructor.
The TransactionScopeOption is an enumeration that provides additional options for creating a transaction
scope. It has the following member values:
??‘ Required??”A transaction is required. A current transaction is used if one already exists; otherwise,
a new transaction is created. This is the default value.
??‘ RequiredNew??”A new transaction is always created.
??‘ Suppress??”The current transaction context is suppressed when creating the scope.
Pages:
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434