Database Replication Functions
Collaboration diagram for Database Replication Functions:

Functions

RDM_RETCODE rdm_dbReplicationSend (RDM_DB db, void *replicationBuffer, size_t bufferSize, size_t *pBytesWritten)
Populate a buffer with all of the changes to an in-memory database. More...
RDM_RETCODE rdm_dbReplicationReceive (RDM_DB db, const void *replicationBuffer, size_t messageSize)
Apply a replication buffer with changes to an in-memory database. More...

Detailed Description

Replication functions for the core database API. All the functions here are located in RDM DB Engine Library. Linker option:

    -lrdmrdm

Function Documentation

rdm_dbReplicationReceive()

RDM_RETCODE rdm_dbReplicationReceive ( RDM_DB db,
const void * replicationBuffer,
size_t messageSize
)

#include <rdmdbapi.h>

Apply a replication buffer with changes to an in-memory database.

This function will apply a replication buffer containing changes to an in-memory database. The replication buffer is generated by rdm_dbReplicationSend.

Locking Requirements
None.
Return values
sOKAY Normal, successful return.
sTRUNCATE Result is truncated.
See also
rdm_rdmReplicationSend
Parameters
[in] db An allocated RDM_DB
[in] replicationBuffer The buffer to read the changes from
[in] messageSize The size of the message

rdm_dbReplicationSend()

RDM_RETCODE rdm_dbReplicationSend ( RDM_DB db,
void * replicationBuffer,
size_t bufferSize,
size_t * pBytesWritten
)

#include <rdmdbapi.h>

Populate a buffer with all of the changes to an in-memory database.

This function will populate a buffer with all of the changes to an in-memory database. The buffer can be used by rdm_dbReplicationReceive to apply the changes to another database.

Locking Requirements
Read lock on all tables
Return values
sOKAY Normal, successful return.
sTRUNCATE Result is truncated.
See also
rdm_rdmReplicationReceive
Parameters
[in] db An allocated RDM_DB
replicationBuffer [in/out] The buffer to write the changes to
[in] bufferSize The size of replicationBuffer
[out] pBytesWritten The number of bytes written into replicationBuffer