Consultor Eletrônico



Kbase P124297: Error 4955 with trigger based replication.
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   6/8/2007
Status: Unverified

FACT(s) (Environment):

All Supported Operating Systems

SYMPTOM(s):

Error 4955 with trigger based replication.

Trigger based replication results in signature mismatch error.

Table signatures do not match in RAW-TRANSFER operation. (4955)

RAW-TRANSFER results in table signature mismatch.

It is difficult to use multiple index key values with trigger based replication.

CAUSE:

The target and source tables of the RAW-TRANSFER operation have a different signature, possibly caused by holes left in schema information due to deleted fields.

For further information see Solution 18430.

FIX:

To work around this problem use temp tables in the trigger based replication as follows. The example described below uses a source2000 and a target2000 database to illustrate replication.

/* ------------------------- Replication source side -------------------------- */
/* Replication write trigger */
TRIGGER PROCEDURE FOR REPLICATION-WRITE OF customer OLD BUFFER oldcust.
DEFINE TEMP-TABLE ttCustomer LIKE customer.
CREATE ttCustomer.
BUFFER-COPY customer TO ttCustomer.
{replication\trig\reptrig.i
&TABLE = Customer
&KEY = STRING(oldcust.custnum)
&Event = WRITE}.
RAW-TRANSFER ttCustomer TO FIELD Replog.DataRecord.


/* reptrig.i */
/* trigger replication include file */
CREATE replog.
ASSIGN
Replog.TransactionID = DBTASKID(LDBNAME(BUFFER RepLog))
Replog.TableName = '{&Table}'
Replog.KeyValue = {&Key}
Replog.Event = '{&Event}'
Replog.LogDate = TODAY
Replog.LogTime = string(TIME).


/* ------------------------- Replication target side -------------------------- */
/* Assumes the source2000 database is already connected */
CONNECT replication/target2000 -1 -ld target2000 NO-ERROR.
IF NOT CONNECTED("target2000") THEN
DO:
MESSAGE "replication target not connected "
VIEW-AS ALERT-BOX INFO BUTTONS OK.
END.
RUN replication/TTtargetupdate.p.
DISCONNECT target2000.


/* TTtargetupdate.p */
DEFINE TEMP-TABLE ttCustomer LIKE target2000.customer.
DEFINE VARIABLE iCustNum AS INTEGER NO-UNDO.

DISABLE TRIGGERS FOR LOAD OF target2000.customer.
FOR EACH source2000.replog EXCLUSIVE:
CREATE ttCustomer.
RAW-TRANSFER source2000.replog.datarecord TO ttCustomer.

FIND FIRST target2000.customer OF ttCustomer EXCLUSIVE-LOCK.

DELETE target2000.customer.
CREATE target2000.customer.
BUFFER-COPY ttCustomer TO target2000.Customer.
DELETE ttCustomer.
DELETE source2000.replog.

MESSAGE "Replicating " SKIP
target2000.customer.custnum SKIP
target2000.customer.name
VIEW-AS ALERT-BOX INFO BUTTONS OK.
END.