<transactedBatching>

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

configuration
  system.serviceModel
    behaviors
      endpointBehaviors
        behavior
          <transactedBatching>

语法

<transactedBatching maxBatchSize="Integer" />

特性和元素

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

特性

属性 说明
maxBatchSize 一个整数,指定可一起成批归入到一个事务中的最大接收操作数。 默认值为 0。

子元素

无。

父元素

元素 说明
<behavior> 指定终结点行为。

备注

采用事务批处理配置的传输尝试将若干接收操作成批归入到一个事务中。 这样做可以避免因创建事务以及在每个接收操作中提交事务所产生的相对较高的成本。

示例

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

<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>

请参阅