In all cases where a jury is discharged or prevented from giving a verdict by reason of an accident or other cause, except where the defendant is discharged during the progress of the trial, or after the cause is submitted to them, the cause may be again tried.