Spring.NET 1.3.0 RC1 for .NET 2.0 API Reference

TransactionTemplate Class

Helper class that simplifies programmatic transaction demarcation and transaction exception handling.

For a list of all members of this type, see TransactionTemplate Members .

System.Object
   DefaultTransactionDefinition
      TransactionTemplate

[Visual Basic]
Public Class TransactionTemplate
    Inherits DefaultTransactionDefinition
    Implements ITransactionOperations, IInitializingObject
[C#]
public class TransactionTemplate : DefaultTransactionDefinition, ITransactionOperations, IInitializingObject

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Remarks

The central methods are Execute and Execute supporting transactional code wrapped in the delegate instance. It handles the transaction lifecycle and possible exceptions such that neither the delegate implementation nor the calling code needs to explicitly handle transactions.

Can be used within a service implementation via direct instantiation with a transaction manager reference, or get prepared in an application context and given to services as object reference.

Note    The transaction manager should always be configured as an object in the application context, in the first case given to the service directly, in the second case to the prepared template.

Supports setting the propagation behavior and the isolation level by name, for convenient configuration in context definitions.

Requirements

Namespace: Spring.Transaction.Support

Assembly: Spring.Data (in Spring.Data.dll)

See Also

TransactionTemplate Members | Spring.Transaction.Support Namespace