This documentation is archived and is not being maintained.

TransactedBatchingBehavior Constructor

Initializes a new instance of the TransactedBatchingBehavior class with the specified batch size.

Namespace:  System.ServiceModel.Description
Assembly:  System.ServiceModel (in System.ServiceModel.dll)

public TransactedBatchingBehavior(
	int maxBatchSize
)

Parameters

maxBatchSize
Type: System.Int32

The maximum number of receive operations that can be batched together.

ExceptionCondition
ArgumentOutOfRangeException

MaxBatchSize is less than 0.

The maxBatchSize value passed into the constructor is only a hint. It is possible that all messages are received before reaching the maxBatchSize. When that occurs, it is unnecessary to wait indefinitely for another message to be received. To prevent this from happening, WCF commits the batch early and open a new batch to receive additional messages. The batch is committed if there are no messages to be received and 20 percent of the transaction time-out value has elapsed.

The following code shows how to create a new instance of TransactedBatchingBehavior specifying the maximum number of messages to be processed in a batch.

endpoint.Behaviors.Add(new TransactedBatchingBehavior(10));

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0
Show: