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 |
---|---|---|
Update | discard | retry | overwrite | pause | abort | newer | older | plsql | sql | error | discard | retry | overwrite | pause | abort | plsql | sql | error |
Delete | discard | retry | overwrite | pause | abort | newer | older | plsql | sql |error | discard | retry | overwrite | pause | abort | plsql | sql | error |
Insert | n/a | discard | retry | overwrite | pause | abort | plsql | sql | error |
Transaction | n/a | discard | 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 | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
To show what the conflict handler has been set to:
Section | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
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.