No, unfortunately I can't share the original code, but I made a few changes to have it as close to the original as possible. I recognized, I missed a detail. The update is part of a forall, like so:
forall idx in 1..textArray.count save exceptions
update books set startText = null
where...