The entry of a nolle prosequi is abolished, and neither the attorney-general nor the prosecuting attorney can discontinue or abandon a prosecution for a public offense except as provided in the last section.