We're here to help!

Global Default Conflict Handler

Follow

The default global setting for conflicts is "retry". This means that the operation will keep trying the operation until a manual change is made on the target to resolve the conflict.

The default global setting for a conflict can be changed with the SET_CONFLICT_HANDLERS FOR DEFAULT command. See the Command Reference or use HELP SET_CONFLICT_HANDLERS for the exact syntax.

 

Example:

dbvrep> SET_CONFLICT_HANDLERS FOR DEFAULT FOR UPDATE ON NO_DATA TO OVERWRITE

This sets the default conflict handler for updates to overwrite.

 

To show the default global conflict handlers use the SHOW_CONFLICT_HANDLERS command:

dbvrep> SHOW_CONFLICT_HANDLERS FOR DEFAULT
The default handling is set 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

This shows the default conflict handler for updates to overwrite.

 

  1. When the default global handlers are updated, this will only APPLY to newly prepared tables. Tables that have already been prepared (or replicated) will still use the previous defined default global handler. 
  2. We recommend to not set nontrivial default conflict handlers for the ERROR handlers. The reason is that if you get 0/many rows affected, the DATA handlers like OVERWRITE, NEWER, OLDER are a good way how to handle the conflict. If they fail, they fall through to the ERROR handler. If the ERROR handler is set to OVERWRITE, NEWER, OLDER, then the ERROR handler could loop forever. 
  3. The default handlers are also used if the conflict is "global", i.e. it's not for a particular table. The most prominent example is a conflict for a commit (e.g. a failed deferred constraint).
Have more questions? Submit a request

Comments