A system and method avoids anomalies in presence of data manipulation
language (DML) plans maintaining dependent objects and snapshot
isolation. An anomaly due to using a snapshot isolation level within the
transaction is detected within a database transaction and the transaction
is aborted based upon that detection. Involved in making the anomaly
detection is determining whether a view of particular data accessed
during the transaction under a snapshot isolation view to ensure read
consistency differs from a view of the data under another isolation
level, such as the read committed isolation level. Then a detection is
made that an anomaly may occur if it is determined that the view of the
data accessed during the transaction under the snapshot isolation differs
from the view of the data under the other isolation level. Such anomaly
avoidance prevents an indexed view being maintained nor a referential
integrity constraint validated based on incorrect data.