
652 S.W.2d 237 (1983)
STATE of Missouri ex rel. Mary Lou HAMILTON, Plaintiff-Relator,
v.
The Honorable Donald DALTON, Judge of the Circuit Court For the County of St. Charles, Defendant-Respondent.
No. 46853.
Missouri Court of Appeals, Eastern District, Division Five.
April 26, 1983.
*238 Thomas M. Kendrick, St. Louis, for plaintiff-relator.
Wayne Schoeneberg, St. Charles, for James A. Mussmann.
KAROHL, Judge.
This is an original proceeding in prohibition to prohibit the respondent circuit judge from proceeding in the cause entitled, James A. Mussmann, and George Mussmann and Jean Mussmann v. Mary Lou Hamilton, defendant, and relator, Cause No. CV182-351CC, now pending in the circuit court of St. Charles County, Missouri.
The underlying suit was filed on February 4, 1982. Essentially the same suit was filed in St. Charles County, Missouri on November 10, 1971, stating a cause of action on behalf of James A. Mussmann, a minor, by his father and next friend, against Mary Lou Hamilton, his school teacher, Ivan Taylor, a school principal, and Fort Zumwalt School District. The complaint alleged serious personal injuries to James' right foot and toes resulting from the collapse of a piano on September 21, 1970. The original petition asked damages from relator Mary Lou Hamilton for her negligence in ordering James to move a piano she should have known was dangerous because of a defect in the rear wheel in that she failed to inspect and discover the defect and to repair or remove the piano from the classroom. Each defendant in the first action filed separate motions to dismiss alleging: (1) that the petition failed to state a cause of action; (2) that the defendants were protected by the doctrine of sovereign immunity; and, (3) the doctrine of in loco parentis. The trial court sustained these motions on July 12, 1972, without indicating the grounds for dismissal. The case was dismissed with prejudice and was not appealed.
The present action, by James, now an adult, relates to the same incident, for the same injuries and charges defendant Mary Lou Hamilton with the same acts of negligence. In Count II, James' parents are co-plaintiffs, asking damages for medical bills, loss of services and their pain and suffering with respect to their son's injuries. Defendant Mary Lou Hamilton filed an answer and pleaded affirmative defenses of res judicata as to both counts and the statute of limitations as to the parents' claim.
Relator Mary Lou Hamilton filed a motion for summary judgment, arguing that the allegations in both petitions stated the identical cause of action and that the dismissal with prejudice in the first action was a final determination on the merits of all of the issues raised in the second action. Therefore, plaintiff's cause of action has been fully adjudicated in her favor. The trial judge denied the motion for summary *239 judgment and this court granted a preliminary writ of prohibition.
In substance, relator Mary Lou Hamilton contends that as a matter of law she is entitled to a declaratory judgment in her favor and for that reason respondent judge has no jurisdiction to proceed, that she has no adequate remedy at law and that further proceedings would violate the general rule of res judicata.
Prohibition is a means of restraint on judicial personnel to prevent usurpation of judicial power, and its essential function is to confine inferior courts to their proper jurisdiction and to prevent them from acting without or in excess of their jurisdiction. State ex rel. Allen v. Yeaman, 440 S.W.2d 138, 145 (Mo.App.1969). It is preventive in nature rather than corrective. The writ issues to restrain the commission of a future act and not to undo one that has already been committed. State ex rel. Ellis v. Creech, 364 Mo. 92, 259 S.W.2d 372, 375 (banc 1953). It is generally allowed to avoid useless suits and thereby minimize inconvenience, and to grant relief when proper under the circumstances at the earliest possible moment in the course of litigation. State ex rel. McDonnell Douglas Corp. v. Gaertner, 601 S.W.2d 295, 296 (Mo. App.1980). But it is not to be granted except when usurpation of jurisdiction or an act in excess of jurisdiction is clearly evident. State ex rel. McCarter v. Craig, 328 S.W.2d 589, 591 (Mo. banc 1959).
A writ of prohibition is a proper remedy where a judge, with jurisdiction of the subject matter and the parties, threatens to act or proceed in a manner so in excess of jurisdiction possessed that he may be said to be acting without jurisdiction. State ex rel. Albert v. Adams, 540 S.W.2d 26, 31 (Mo. banc 1976); State ex rel. McCubbin v. McMillian, 349 S.W.2d 453, 457 (Mo.App.1961). However, the relator has the burden to establish that respondent judge will usurp or act in excess of his jurisdiction in overruling her motion for summary judgment. See State ex rel. Tarrasch v. Crow, 622 S.W.2d 928, 937 (Mo. banc 1981).
An analysis of the pleadings in both suits necessarily results in the conclusion that they state the same cause of action for the same events and for the same injuries. On these facts it is unnecessary to resort to any evidence dehors the pleadings to determine that there are no material issues of fact or law remaining and that plaintiff's cause of action is barred by the doctrine of res judicata. Any further proceedings by defendant circuit judge would be in excess of his jurisdiction.
Relator Mary Lou Hamilton was entitled to a declaratory judgment in her favor and is now entitled to a writ prohibiting respondent circuit judge from proceeding, other than to enter such judgment. Rule 97; § 530.010 RSMo 1978. To proceed further would be a waste of judicial effort and would involve an unrecoverable expense of both time and resources on behalf of the court and all parties.
Regarding the parents' claim for damages under Count II, respondent argues that the affirmative defense of statute of limitations was not made a part of the motion for summary judgment. It was pleaded as an affirmative defense, however, and was briefed and argued in support of the motion for summary judgment. Clearly the parents' claim is derivative and is collaterally estopped. Further it is barred by the five-year statute of limitations which expired on September 21, 1975. § 516.120 RSMo 1978.
Where reference to the pleadings alone conclusively demonstrates that the pending petition attempts to state a cause of action barred by res judicata or by the applicable statute of limitations, summary judgment should be entered as a matter of law and prohibition will lie for failure to do so.
The preliminary writ heretofore issued is made absolute.
PUDLOWSKI, P.J., and DOWD, J., concur.
