Dismissal of actions.
Section 127
SEC. 127. Dismissal of actions. — An action may be dismissed, with costs to the defendant, in the following cases: 1. By the plaintiff himself, by written request to the clerk filed among the papers in the case, at any time before trial, upon payment of the costs; provided a counterclaim has not been made, or affirmative relief sought by the cross complaint or answer of the defendant, or provided the judge shall not decide that the defendant has made such preparation for trial that it would be unjust to permit a dismissal without a trial on the merits; 2. By the court, when the plaintiff fails to appear at the time of trial, and the defendant appears and asks for the dismissal; 3. By the court, when the plaintiff fails, for an unreasonable length of time to prosecute his action. In either of these three cases a dismissal of the action shall not be a bar to another action for the same cause; 4. The court may also, in its discretion, allow a plaintiff to dismiss the action on payment of the costs after the trial has begun and at any time before final judgment, if the interests of justice so require, and in this case the dismissal shall not be a bar to another action for the same cause. The dismissal shall be entered on the docket of the court and shall be effective, when so entered, to end the action.