Wrap sample update in transaction