TTXlaTableHandler Reference
The TTXlaTableHandler
class provides methods that enable and disable change tracking for a table. Methods are also provided to handle update notification records from XLA.
Protected Members
Member | Description |
---|---|
|
This is for the metadata associated with the table being handled. |
|
This is used to view the row being inserted or deleted, or the old image of the row being updated, in user-written |
|
This is used to view the new image of the row being updated in user-written |
Public Methods
This section summarizes then describes the TTXlaTableHandler
public methods.
Public methods summary
Method | Description |
---|---|
Disables XLA update tracking for the table. |
|
Enables XLA update tracking for the table. |
|
Returns the SQL associated with a given XLA record. |
|
Dispatches a record from |
|
This is invoked when the |
|
This is invoked when the |
|
This is invoked when the |
DisableTracking()
virtual void DisableTracking()
Disables XLA update tracking for the table. After this method is called, the XLA bookmark no longer captures information about changes to the table.
EnableTracking()
virtual void EnableTracking()
Enables XLA update tracking for the table. Until this method is called, the XLA bookmark does not capture information about changes to the table.
generateSQL()
void generateSQL (ttXlaUpdateDesc_t* updateDescP, char* buffer,
SQLINTEGER maxByteLen, SQLINTEGER* actualByteLenP)
This method prints the SQL associated with a given XLA record. The SQL string is returned through the buffer
parameter. Allocate space for the buffer and specify its maximum length, maxByteLen
. The actualByteLenP
parameter returns information about the actual length of the SQL string returned.
If maxByteLen
is less than the length of the generated SQL string, a TTStatus
error is thrown and the contents of buffer
and actualByteLenP
are not modified.
HandleChange()
virtual void HandleChange(ttXlaUpdateDesc_t* updateDescP)
virtual void HandleChange(ttXlaUpdateDesc_t* updateDescP, void* pData)
Dispatches a ttXlaUpdateDesc_t
object to the appropriate handling routine for processing. The update description is analyzed to determine if it is for a delete, insert or update operation. The appropriate handing method is then called: HandleDelete()
, HandleInsert()
, or HandleUpdate()
.
Classes that inherit from TTXlaTableHandler
can use the optional pData
parameter when they overload the TTXlaTableHandler::HandleChange()
method. This optional parameter is useful for determining whether the batch of XLA records that was just processed ends on a transaction boundary. Knowing this helps an application decide the appropriate time to invoke TTConnection::ackUpdates()
. See Acknowledging XLA Updates at Transaction Boundaries for an example that uses the pData
parameter.
Also see HandleChange() for TTXlaTableList
objects.
HandleDelete()
virtual void HandleDelete(ttXlaUpdateDesc_t* updateDescP) = 0
This method is invoked whenever the HandleChange()
method is called to process a delete operation.
HandleDelete()
is not implemented in the TTXlaTableHandler
base class. It must be implemented by any classes derived from it, with appropriate logic to handle deleted rows.
The row that was deleted from the table is available through the protected member row
of type TTXlaRowViewer
.
HandleInsert()
virtual void HandleInsert(ttXlaUpdateDesc_t* updateDescP) = 0
This method is invoked whenever the HandleChange()
method is called to process an insert operation.
HandleInsert()
is not implemented in the TTXlaTableHandler
base class. It must be implemented by any classes derived from it, with appropriate logic to handle inserted rows.
The row that was inserted into the table is available through the protected member row
of type TTXlaRowViewer
.
HandleUpdate()
virtual void HandleUpdate(ttXlaUpdateDesc_t* updateDescP) = 0
This method is invoked whenever the HandleChange()
method is called to process an update operation.
HandleUpdate()
is not implemented in the TTXlaTableHandler
base class. It must be implemented by any classes derived from it, with appropriate logic to handle updated rows.
The previous version of the row that was updated from the table is available through the protected member row
of type TTXlaRowViewer
. The new version of the row is available through the protected member row2
, also of type TTXlaRowViewer
.