Product Documentation

FairCom RTG COBOL User Guide

Previous Topic

Next Topic

<batchaddition>

The batchaddition option enables batch record writes to improve performance of consecutive record additions. This is achieved by caching the records being added in the client side before they are sent in one batch operation to the server to be written to disk. The records are sent to the server after a given number of records (specified by the records attribute) have been added or when the file is closed. Since the records are actually written when they are sent to the server, a duplicate key error is returned by the operation that triggered the batch write operation. For this reason, batchaddition is recommended only for specific operations such as data import where duplicate errors are not expected. It is important that COBOL applications performing batchaddition check the status of CLOSE operations to detect possible errors writing records.

Writing records in batches improves performance of large record additions in environments where client and server reside on different systems connected with a network. In such environments any request from the client to the server is sent over the network which is generally a time-expensive operation.

The batchaddition option is available only for files opened with OUTPUT or EXTEND mode.

The number of records to cache is defined by the records attribute.

The batchaddition option is disabled by default.

Note: Adding records using <batchaddition> within explicit transactions started by the user is not supported. If a file is OPEN WITH ROLLBACK and the file is configured for <batchaddition>, any WRITE operation that adds a record within an active transaction will fail until the transaction ends with a Commit or Rollback. To add records to a file with OPEN WITH ROLLBACK and <batchaddition> enabled, perform WRITE operations without starting a transaction.

Accepted Values

Value

Effect

Synonyms

yes

Enable the record batch addition.

y, true, on, 1

no

Disable record batch addition. This is the default value.

n, false, off, 0

Attributes

Attribute

Description

Synonyms

records

Indicates the number of records to cache. This value is set to 100 by default.

recs

Examples

<batchaddition records="50">yes</batchaddition>

TOCIndex