Design Considerations
In another example, delete conflicts can be
avoided by a simple strategy. Instead of deleting the rows, the
rows can simply be marked for deletion. One specified site can
then take charge and delete them. In this way, a potential
delete conflict issue can be avoided.
Pre-built update conflict handlers
Before moving on to an examination of the
conflict handlers, it is important to understand what a column
list is and what the resolution columns are. The column list
indicates the set of columns for which the update conflict
handler is called when there is an update conflict. The
resolution columns are the columns which will be used to
identify an update handler. Also in some cases, resolution
columns will be used to resolve the conflict.
Oracle provides four types of pre-built
update conflict handlers. They are OVERWRITE, DISCARD, MAXIMUM
and MINIMUM. The following example will illustrate the use of
these handlers.
A row in the ALLINSURED table with polno
452366 is updated at the NY site and at the same time at London
site. The update at the NY site changes the value of the
SUM_ASSURED column to 45000 from 35000, but the London site
changes the value to 62000 from 35000. When the row LCR from NY
reaches the London site, it finds the old value of 62000 instead
of expected 35000.
When used, the OVERWRITE handler, in the
above situation, will overwrite the value at the London site
value with 45000 and the conflict is resolved.