Say you have this in your table
And in your input stream you have this:
ID: 2, NAME: DAN, change_field: new
ID: 1, NAME: DAN, change_field: deleted
If you have a unique constraint on NAME then this will generate an error.
So I tried to change the ordering in the code, and thought I had a solution but it didnt work - i tried re-ordering the code around line 374 in SynchronizeAfterMerge.java, but that didnt help ( i.e. do the delete first )
But that idea, to do deletes first, is only a partial fix to the specific case above. Really wouldnt it be better if it used a single transaction for all the updates/inserts/deletes and then you'd never have this problem?
SQL for the table:
CREATE TABLE "INTERFACE_STAGING"."TEST_SAM_DAN"
( "ID" NUMBER PRIMARY KEY,
"NAME" VARCHAR2(2000 CHAR),
CREATE UNIQUE INDEX "idx_sam_dan" ON TEST_SAM_DAN ( NAME )