Product Documentation

c-treeDB API for C++ - Developers Guide

Previous Topic

Next Topic

CTRecord::EndBatch

Terminates or cancels a batch operation.

Declaration

void CTRecord::EndBatch();

Description

A batch operation must be terminated by calling the CTRecord::EndBatch() function. Once a batch operation is started, by calling CTRecord::SetBatch(), no other batch operation is allowed to start until the current batch operation is terminated.

When performing batch retrieval operations, you may cancel the batch operation before retrieving all the records by calling CTRecord::EndBatch().

If the batch operation is a CTBATCH_RANGE them you must also call the CTRecord::RangeOff() function to terminate the index range used for the batch operation.

In case of errors, CTRecord::EndBatch() throws a CTException.

Return

void

Example


try

{

// set the partial target key

hRecord.Clear();

hRecord.SetFieldAsSigned("Invoice", Invoice);

// set the batch operation

hRecord.SetBatch(CTBATCH_DEL, sizeof(Invoice), 0);

// end the batch operation

hRecord.EndBatch();

}

catch (CTException& err)

{

printf("Batch failed with error %d\n", hRecord.GetError());

}

See Also

TRecord::BatchLoaded(), CTRecord::BatchLocked(), CTRecord::BatchMode(), CTRecord::BatchTotal(), CTRecord::InsertBatch(), CTRecord::IsBatchActive(), CTRecord::NextBatch(), CTRecord::SetBatch()

TOCIndex