Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 8 Next »

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 above. The Dbvisit Replicate command to set conflict handlers is SET_CONFLICT_HANDLERS.

The options for conflict handles are as follows:

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

The transaction handler is used for DDL, commits etc.

The "Data" 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:

  • log: the conflict is logged, and a error plog is created with the offending statement
  • nolog: the conflict is not logged
  • fast_nolog: the conflict is not logged and it may be omitted from conflict counters altogether
  • log_transaction: the conflict is logged, and a error plog is created with the offending transaction
  • default: same as log

See the Command Reference or use HELP SET_CONFLICT_HANDLERS for the exact syntax.
Use SHOW_CONFLICT_HANDLERS to query current settings of handlers.

Example setting a conflict handler on a table:

 

dbvrep> SET_CONFLICT_HANDLERS FOR TABLE SCOTT.AVI_OBJECTS FOR UPDATE ON DATA TO OVERWRITE

To show what the conflict handler has been set to:

 

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 (data): handler: OVERWRITE logging: LOG
DELETE (error): handler: RETRY logging: LOG
DELETE (data): handler: RETRY logging: LOG
INSERT (error): handler: RETRY logging: LOG
TRANSACTION (error): handler: RETRY logging: LOG
  • No labels