Enterprise Replication supports built-in data types and user-defined data types, including row types and collection types. This section describes how Enterprise Replication handles special data types:
For general information on data types, refer to the IBM Informix Guide to SQL: Reference.
If you use SERIAL or SERIAL8 data types, you must be careful when defining serial columns. For more information, see SERIAL Data Types and Primary Keys.
Enterprise Replication supports all primitive data types across heterogeneous hardware. If you define a replicate that includes non-primitive data types (for example, BYTE and TEXT data), the application must resolve data-representation issues that are architecture dependent.
If you use floating-point data types with heterogeneous hardware, you might need to use IEEE floating point or canonical format for the data transfers. For more information, see Using the IEEE Floating Point or Canonical Format.
Enterprise Replication replicates:
You can store simple large objects either in the tblspace with the rest of the table columns (in a dbspace) or in a blobspace.
For more information about database storage, see the IBM Informix Dynamic Server Administrator's Guide.
Simple large object data that is stored in tblspaces (rather than in blobspaces) is placed in the logical log. Enterprise Replication reads the logical log to capture and evaluate the data for potential replication.
Enterprise Replication does not retrieve simple large object data that is stored in blobspaces and smart large object data that is stored in sbspaces from the logical log. Instead, Enterprise Replication retrieves the large object data directly from the blobspace or sbspace before sending the data to the target database server.
It is possible that a transaction subsequent to the transaction being replicated can modify or delete a simple or smart large object that Enterprise Replication is trying to retrieve. If Enterprise Replication encounters a row whose large object (simple or smart) has been modified or deleted by a subsequent transaction, Enterprise Replication does not send the data in the large object.
In most cases, the subsequent transaction that modified or deleted the large object will also be replicated, so the data again becomes consistent once that transaction is replicated. The data in the large object is inconsistent for only a short time.
Keep in mind that if you specify sending only the columns that changed, the data might not get updated during the next update of the row. For more information, see Replicating Only Changed Columns.
By default, Enterprise Replication performs all conflict detection and resolution at the row level. However, in some cases, simple large object data that is stored in a tblspace (rather than in a blobspace) is accepted by the target server even if the row is rejected. This does not apply to simple large object data that is stored in blobspaces or smart large object data that is stored in sbspaces.
When a replicated BYTE or TEXT column is modified on the source database server, Enterprise Replication records the value of cdrserver and cdrtime for that column. (For more information on cdrserver and cdrtime, see Preparing Tables for Conflict Resolution.) If the column on the target database server is also stored in a tablespace (rather than in a blobspace), Enterprise Replication evaluates the cdrserver and cdrtime values in the source and target columns and uses the following logic to determine if the data is to be applied:
If the replicate is defined with an SPL conflict-resolution rule, the SPL routine must return the desired action for each BYTE or TEXT column. When the routine is invoked, information about each BYTE or TEXT column is passed to the routine as five separate fields. The following table describes the fields.
Argument | Description |
---|---|
Column size (INTEGER) | The size of the column (if data exists for this column). NULL if the column is NULL. |
BLOB flag [CHAR(1)] | For the local row, the field is always NULL.
For the replicated row:
|
Column type [CHAR(1)] |
|
ID of last update server [CHAR(18)] | The ID of the database server that last updated this column
for tablespace data.
For blobspace data: NULL |
Last update time (DATETIME YEAR TO SECOND) | For tablespace data: The date and time when the data was last updated. For blobspace data: NULL |
For information on creating stored procedures, see the IBM Informix Guide to SQL: Tutorial.
If the routine returns an action code of A, D, I, or U, the routine parses the return values of the replicated columns. Each BYTE or TEXT column can return a two-character field. For information about the action codes, refer to SPL Conflict-Resolution Rule.
The first character defines the desired option for the BYTE or TEXT column, as the following table shows.
Value | Function |
---|---|
C | Performs a time-stamp check for this column as used by the time-stamp rule |
N | Sets the replicate column to NULL |
R | Accepts the replicated data as it is received |
L | Retains the local data |
The second character defines the desired option for blobspace data if the data is found to be undeliverable, as the following table shows.
Value | Function |
---|---|
N | Sets the replicated column to NULL |
L | Retains the local data (default) |
O | Aborts the row |
X | Aborts the transaction |
Enterprise Replication handles conflict resolution for smart large objects using the SPL conflict-resolution rule in the same way as for simple large objects. See Conflict Resolution for Simple and Smart Large Objects.
If Enterprise Replication processes a row and discovers undeliverable BYTE or TEXT columns, the following actions can occur:
The following conditions apply to replicating smart large objects:
UPDATE table_name SET smart_large_object_column = x
For more information, see the IBM Informix Guide to SQL: Syntax.
Enterprise Replication supports built-in data types and extended data types, including opaque data types and user-defined types (UDTs).
You must install and register UDTs and their associated support routines on all database servers participating in Enterprise Replication prior to starting replication.
If you combine Enterprise Replication with High-Availability Data Replication (HDR), you must install UDTs on both HDR database servers, but only register them on the primary HDR database server (see IBM Informix Dynamic Server Administrator's Guide).
If you plan to replicate opaque user-defined types (UDTs), the UDT designer must provide two support functions, streamwrite() and streamread(). This also applies to UDTs embedded in complex types.
The purpose of these functions is similar to the existing send() and receive() functions provided for client/server transmissions.
For information on writing these support functions, see the section on Enterprise Replication stream support functions in the IBM Informix DataBlade API Programmer's Guide.
When preparing a row that includes any UDT columns to queue to the target system, Enterprise Replication calls the streamwrite() function on each UDT column. The function converts the UDT column data from the in-server representation to a representation that can be shipped over the network. This allows Enterprise Replication to replicate the column without understanding the internal representation of the UDT.
On the target server, Enterprise Replication calls the streamread() function for each UDT column that it transmitted using the streamwrite() function.
The following conditions apply to replicating opaque data types:
See Participant Modifier for information on the WHERE clause in participant definitions.
See Conflict Resolution and Replicating Only Changed Columns.
For more information, see the section on primary key constraints in the IBM Informix Guide to SQL: Syntax.
To replicate tables that form a hierarchy, you must define a separate replicate for each table. If you define a replicate on a super table, Enterprise Replication does not automatically create implicit replicate definitions on the subordinate tables.
You must use conflict resolution uniformly for all tables in the hierarchy. In other words, either no conflict resolution for all tables or conflict resolution for all tables.
By using master replicates you can verify that all participants in a replicate have columns with matching data types. Master replicates also allow verification that each participant contains all replicated columns, and optionally that column names are the same on each participant. See Defining Master Replicates for more information.
Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]