Shouldn't this happen *after* the update completed successfully? Ideally, this should be inside a transaction, shouldn't it?