<transactedBatching>

指定是否支持接收作的事务批处理。

<配置>
   <system.serviceModel>
     <行为>
       <endpointBehaviors>
         <行为>
           <transactedBatching>

Syntax

<transactedBatching maxBatchSize="Integer" />

特性和元素

下列各节描述了特性、子元素和父元素。

特性

Attribute Description
maxBatchSize 一个整数,指定可在一个事务中一起批处理的最大接收作数。 默认值为 0。

子元素

没有。

父元素

元素 Description
<行为> 指定终结点行为。

注解

配置了事务批处理的传输尝试将多个接收作批处理到一个事务中。 这样做可以避免创建事务并在每个接收作中提交事务的成本相对较高。

Example

以下示例演示如何将事务处理批处理行为添加到配置文件中的服务。

<system.serviceModel>
  <services>
    <service name="Microsoft.ServiceModel.Samples.CalculatorService"
             behaviorConfiguration="CalculatorServiceBehavior">
      <host>
        <baseAddresses>
          <add baseAddress="http://localhost:8000/ServiceModelSamples/service" />
        </baseAddresses>
      </host>
      <!-- Define NetMsmqEndpoint -->
      <endpoint address="net.msmq://localhost/private/ServiceModelSamples"
                binding="netMsmqBinding"
                contract="Microsoft.ServiceModel.Samples.IQueueCalculator" />
      <!-- the mex endpoint is exposed at http://localhost:8000/ServiceModelSamples/service/mex -->
      <endpoint address="mex"
                binding="mexHttpBinding"
                contract="IMetadataExchange" />
    </service>
  </services>
  <behaviors>
    <endpointBehaviors>
      <behavior name="endpointBehavior">
        <transactedBatching maxBatchSize="10" />
      </behavior>
    </endpointBehaviors>
    <serviceBehaviors>
      <behavior name="CalculatorServiceBehavior">
        <serviceMetadata httpGetEnabled="true" />
      </behavior>
    </serviceBehaviors>
  </behaviors>
</system.serviceModel>

另请参阅