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 5 Next »

  • DISCARD: ignore the offending SQL and continue with the next one
  • OVERWRITE: do not check old values, try again with just primary key in the where clause (thus this will fail if there is no row at all on apply with the PK value)
  • NEWER,OLDER: look into target table (by primary key) and get values of specified columns (usually dates or number sequence). If the source row is newer/older, the operation becomes OVERWRITE, otherwise DISCARD.
  • PLSQL: call user-specied PL/SQL function. The function must have prototype:

f(apply_old_data table%rowtype, has_found_apply_row boolean, primary_key_data table%rowtype, new_data table%rowtype) return number;
The return values are:

    • 0: discard
    • 1: overwrite
    • 2: retry
    • 3: the PL/SQL function resolved the conflict by itself and made all necessary changes.

The function must not issue a commit, as the transaction may be yet rolled back, if a rollback happened on source.

  • RETRY: wait a few seconds (set by variable RETRY_TIME ) and try again
  • PAUSE: wait for manual user resolution
  • ABORT: kill apply process
  • ERROR: rollback the transaction, continue applying other transactions
Note: all the configured conflict handlers are listed in table: DBRSAPPLY_CONFLICT_HANDLERS. 
This has the same result running the command: dbvrep> SHOW_CONFLICT_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

See the Command Reference or use HELP SET_CONFLICT_HANDLERS for the exact syntax.

  • No labels