A comment indicating why the clear is needed here would be useful

(I assume it is because you need it to be cleared before the implicit transaction destructor)

Same applies elsewhere.