Make entity removal operate transactionally