This topic presents an overview of the Record Store API core methods.
The Record Store API has a RecordStore
interface, which is used to make calls to a Record Store instance.
The following Record Store core operations are provided by methods in the RecordStore
interface:
startTransaction()
starts a transaction of type READ or READ_WRITE and returns the transaction ID.startBaselineRead()
creates a read cursor for reading a baseline generation from a Record Store instance.startDeltaRead()
creates a read cursor for an incremental read from a Record Store instance.readRecords()
performs the actual read operation for a read cursor set up by either thestartBaselineRead()
or thestartDeltaRead()
method.endRead()
ends a baseline or incremental read operation performed by areadRecords()
method.readRecordsById()
reads specific records from a Record Store instance, based on a list of their record IDs.writeRecords()
writes a set of records to a Record Store instance. The method returns an integer that indicates how many records were actually written.commitTransaction()
commits an active (uncommitted) transaction.rollbackTransaction()
rolls back an active (uncommitted) transaction.listActiveTransactions()
returns aList
ofTransactionInfos
that contain the ID, type, status, and generation ID of each active transaction.listGenerations()
returns aList
ofGenerationInfos
for each record generation currently in the Record Store.getLastCommittedGenerationId()
gets the ID of the last-committed record generation.getWriteGenerationId()
gets the ID of the current generation.setLastReadGenerationId()
sets state for a specific client by setting the ID of the last generation read by the client.getLastReadGenerationId()
gets the ID of the last-read generation that was set for a specific client.listClientStates()
returns aList
ofClientStateInfos
for each client. EachClientStateInfo
object contains a client ID, a transaction ID, a generation ID of the last read generation, and a Boolean to indicate if the state is committed.getConfiguration()
returns the configuration settings of a specified Record Store instance.setConfiguration()
sets the configuration settings of a specified Record Store instance.clean()
runs the Record Store Cleaner, which removes all records that are no longer necessary. This method allows cleaning to occur on an external schedule.
The procedures required for typical Record Store usage scenarios are described in subsequent topics.
Note