Update controller.php

Build up an array of rows to update to prevent locking on MSSQL.