Callback function input parameters
The structures described in this section hold input parameters that are passed to the callback functions.
rxEVENT
)typedef struct _rxevent { LONG versn; /* [IN] version of this structure */ LONG errcod; /* [IN] Error code */ pctCNXH psrccnxhnd; /* [IN] Source server connection handle */ pctCNXH ptgtcnxhnd; /* [IN] Target server connection handle */ pVOID pusrctx; /* [OUT] User context pointer */ RXACT action; /* [OUT] Set to action to take */ union { rxVEROP verop; /* [IN] Parameters for version check */ rxFILOP filop; /* [IN] Parameters for file events */ rxTRNOP trnop; /* [IN] Parameters for transaction events */ rxDATOP datop; /* [IN] Parameters for data events */ rxEXCOP excop; /* [IN] Parameters for exceptions */ } ev;
Input/output | Description |
---|---|
Input | Structure version |
Input | Error code for the current event |
Input | Source server connection handle (can be used to call Replication API functions such as |
Input | Target server connection handle (an be used to call Replication API functions such as |
Input | Replication Agent unique ID |
Input | Source server name |
Input | Target server name |
Input | Source server node ID |
Input | Target server node ID |
Input | One of the following structures depending on the type of event:
|
Output | Optional user-defined context pointer (can be used to store a pointer to memory allocated by the external library) |
Output | Action to take for this event Supported actions are:
|
The Replication Agent version structure (rxVEROP
) is only used for the start agent event. The start agent callback function must set the fields of this structure to the structure versions in use by the external library so that the agent can verify that the external library is compatible. See the sample start agent callback function for an example of setting these values.
typedef struct _rxverop { LONG verop_ver; /* [OUT] Set to version of rxVEROP */ LONG event_ver; /* [OUT] Set to version of rxEVENT */ LONG filop_ver; /* [OUT] Set to version of rxFILOP */ LONG trnop_ver; /* [OUT] Set to version of rxTRNOP */ LONG datop_ver; /* [OUT] Set to version of rxDATOP */ LONG excop_ver; /* [OUT] Set to version of rxEXCOP */ LONG filh_ver; /* [OUT] Set to version of ctFILH */ } rxVEROP, *prxVEROP;
rxFILOP
)The file operation structure (rxFILOP
) is passed to file operation callbacks.
typedef struct _rxfilop { pctCHGB pchgbuf; /* [IN] File operation details */ pctFILH pfilhnd; /* [IN] File information */ } rxFILOP, *prxFILOP;
Input/output | Description |
---|---|
Input | File operation details for this event (includes log position |
Input | File information for this event (includes data file ID, data file name, and data file number if open) |
rxTRNOP
)The transaction operation structure (rxTRNOP
) is passed to transaction operation callbacks.
typedef struct _rxtrnop { pctCHGB pchgbuf; /* [IN] Transaction operation details */ } rxTRNOP, *prxTRNOP;
Input/output | Description |
---|---|
Input | Transaction operation details for this event (includes log position and transaction number) |
rxDATOP
)The data operation structure (rxDATOP
) is passed to data operation callbacks.
typedef struct _rxdatop { pctCHGB pchgbuf; /* [IN] Data operation details */ pctFILH pfilhnd; /* [IN] File information */ } rxDATOP, *prxDATOP;
Input/output | Description |
---|---|
Input | Data operation details for this event (includes log position, file ID, unique key, record image (the callback can change the key value and record image) |
rxEXCOP
)The exception operation structure (rxEXCOP
) is passed to exception callbacks.
typedef struct _rxexcop { LONG errcod; /* [IN] Error code */ pctCHGB pchgbuf; /* [IN] Operation that failed */ pctFILH pfilhnd; /* [IN] File information */ } rxEXCOP, *prxEXCOP;
Input/output | Description |
---|---|
Input | Error code for this exception. |
Input | Details for the operation that failed (includes information relevant to the type of operation that failed — for example, data operation includes log position, file ID, unique key, and record image) |
Input | File information for this exception (includes data file ID, data file name, and data file number if open) |