Move auto commit reset to `finally` block