Move modify_settings at higher level so that all apps are flushed properly.
This is necessary because Oracle backend won't cascade deletions when calling flush.