Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The response to a conflict can be configured before the conflict occurs. This is done with conflict handlers. The configuration can be specified for each replicated table and for each operation type separately, and for the special case ("data" divergence) mentioned abovewhen zero or more than one row are affected. The Dbvisit Replicate command to set conflict handlers is SET_CONFLICT_HANDLERS.

The options for conflict handles are as follows:

Operations"Data" handler"NO_DATA" and "TOO_MANY" handlers"Error" handler
Updatediscard | retry | overwrite | pause | abort | newer | older | plsql | sql | errordiscard | retry | overwrite | pause | abort | plsql | sql | error
Deletediscard | retry | overwrite | pause | abort | newer | older | plsql | sql |errordiscard | retry | overwrite | pause | abort | plsql | sql | error
Insertn/adiscard | retry | overwrite | pause | abort | plsql | sql | error
Transactionn/adiscard | retry | overwrite | pause | abort | plsql | sql | error

The transaction handler is used for DDL.

The "DataNO_DATA" and "TOO_MANY" handler is used only once for a conflict – if using this handler leads to a conflict again, "Error" handler is used for the next attempt. For the next change SQL, the Data conflict will be used again. 
Additionally, logging may be specified:

...

 

Section
Column
width5%

 

Column
width95
Panel
bgColorCCC
dbvrep> SET_CONFLICT_HANDLERS FOR TABLE SCOTT.AVI_OBJECTS FOR UPDATE ON NO_DATA TO OVERWRITE

To show what the conflict handler has been set to:

Section
Column
width5%

 

Column
width95
Panel
bgColorCCC
dbvrep> show_conflict_handlers for table scott.avi_objects 
The table called SCOTT.AVI_OBJECTS on source is handled on apply as follows:
UPDATE (error): handler: RETRY logging: LOG
UPDATE (no_data): handler: OVERWRITE logging: LOG
UPDATE (too_many): handler: OVERWRITE logging: LOG
DELETE (error): handler: RETRY logging: LOG
DELETE (no_data): handler: RETRY logging: LOG
DELETE (too_many): handler: RETRY logging: LOG
INSERT (error): handler: RETRY logging: LOG
TRANSACTION (error): handler: RETRY logging: LOG

 

Note that previous versions used the DATA handler instead of NO_DATA and TOO_MANY. For compatibility reasons, this is still supported - specifying DATA handler sets both NO_DATA and TOO_MANY handlers.