Might be worth using the -inTransaction:rollback: pattern here mentioned above.