JBTM-2167 Updated so that we commit the transaction if there is nothing to update before attempting to commit to avoid deadlock in MySQL