The defendants contend that the claims asserted in this suit are barred by the doctrine of res judicata.
Background Facts
On May 14,1990, the plaintiffs (Lux) executed a deed of trust to secure a note payable to Spotswood Construction Loans, a limited partnership (Spotswood). The loan was secured by a residence owned by Lux and located on Glen Eagles Drive, Maple Grove Subdivision, in Spotsylvania County. (Mr. Lux was a professional builder. At some point, however, the Lux family occupied the property as their home.) Kenneth S. Potter and Alan L. Potter (the trustees) were named trustees under the deed of trust.
When the note went into default, the trustees — or Kenneth S. Potter acting for both of them — took steps to acquire possession of the security and to foreclose. Those actions have generated several rounds of litigation of which this suit is the latest.
To understand the defendants’ plea of res judicata, it is necessary to examine in some detail the claims asserted here and the claims adjudicated in the prior proceedings.
The Claims in This Case
Lux instituted this chancery suit on January 20, 1995, against Spotswood and the trustees. The nucleus of the suit is the foreclosure. The *70foreclosure sale occurred on July 16, 1992. Spotswood purchased the property at the sale. Lux alleges that the trustees connived with Spotswood, a partnership in which they had a financial interest, “contrary to and in violation of their fiduciary duties.” Lux complains that the foreclosure and other related actions specified in the bill were initiated by the trustees “willfully and maliciously” and caused “needless litigation, expense, undue hardship, emotional distress .. . .” Fraud is intimated. Further, Lux alleges that Kenneth S. Potter, an attorney and one of the trustees, breached his trust duties to Lux by charging attorney’s fees, thereby “using the trust for private gain.”
In the prayers for relief, Lux asks that the foreclosure be set aside; that the trustees be removed and a “suitable” substitute appointed; that the trustees make an accounting; that the court order the return of $15,000.00 posted as an appeal bond by Lux in a previous case and later paid over to the defendants as compensation for damages; and an award of compensatory and punitive damages.
In response, the defendants filed, among other things, a demurrer, a plea of res judicata, and a plea of laches. The court decided to address first the plea of res judicata, and the parties argued that matter on March 22, 1995.
The Claims in Prior Cases
1. Case # 1. When the note went into default, Kenneth S. Potter instituted an unlawful detainer action against Lux on behalf of Spotswood in the general district court. The case was dismissed on December 18, 1991, for reasons not apparent on the face of the court order.
2. Case # 2. Bankruptcy Proceedings. About a month after the unlawful detainer action was dismissed, the trustees gave notice of foreclosure. Lux filed a petition in bankruptcy, automatically halting the foreclosure. The stay was lifted on April 22,1992, and the trustees issued another foreclosure notice.
Lux filed a second bankruptcy petition. The bankruptcy court found that the second filing was made in bad faith. Consequently, the trustees gave notice of foreclosure a third time.
Undeterred, Lux initiated adversary proceedings in the bankruptcy case, which had not been finally dismissed, including a request to enjoin the foreclosure. Lux contended, among other things, that the trustees and Spotswood had conspired to violate the prior automatic stay and to devalue the property. The injunction was denied on July 14, 1992, and the remainder of the proceedings were dismissed on October 27, 1992.
*71Lux’s appeals to the United States District Court and the U.S. Court of Appeals for the Fourth Circuit were unsuccessful.
The foreclosure took place on July 16,1992, and Spotswood purchased the property for the bid price of $110,000.00.
3. Case #3. A week after the foreclosure, Spotswood initiated another unlawful detainer action in the general district court. After a trial on September 26,1992, Spotswood was granted possession, and Lux was ordered to vacate the premises by September 28, 1992. Lux noted an appeal to circuit court and posted a $4,800.00 bond.
The case was tried de novo in this court on March 30, 1993 (# L92785). The court granted immediate possession to Spotswood, awarded damages against which the $4,800.00 was applied, and set a new bond of $15,000.00 to stay execution of the writ of possession in the event Lux appealed. The petition for appeal was dismissed by the Virginia Supreme Court, and a petition for rehearing was denied. A writ of certiorari to the United States Supreme Court was denied. Thereafter, this court issued a writ of possession and applied the $15,000.00 cash bond against damages. Spotswood finally acquired possession of the property in May of 1994.
4. Case # 4. Lux filed a chancery suit (# C92-825) on October 14,1992, against Spotswood and the trustees, seeking to set aside the foreclosure. The allegations were substantially the same as those in this suit. Specifically, Lux alleged that the foreclosure was fraudulent and that the trustees had breached their fiduciary duties. Lux also asked for compensatory and punitive damages.
The court sustained the defendants’ demurrer. Lux filed an amended bill, but on the day of trial, he took a nonsuit.
5. Case # 5. Lux instituted a law action against Spotswood, the trustees, and Sherry Gillis, an employee of Spotswood (# L93-387). Lux sought compensatory and punitive damages and contended that the foreclosure sale must be set aside. In the motion for judgment, Lux contended that the defendants conspired to acquire the property at foreclosure and resell it at a considerable profit, that the defendants had given false testimony in previous proceedings to cover up their fraud and breach of fiduciary duties, and that the defendants were unjustly enriched as a result of the trustees’ self-dealing. The motion for judgment characterized the defendants’ conduct as “willful, wanton, without just cause and in calous [sic] disregard of the plaintiff’s rights causing severe emotional stress ... .”
The defendants filed a motion to transfer the case to the equity side of the court and a demurrer. The demurrer contained several subparts, the *72essence of which was that the claims asserted in the motion for judgment, even assuming that they were true, did not state a cause of action. After a hearing, the court sustained the demurrer on March 23, 1994.
Lux filed an amended motion for judgment. (Lux had been given leave to file an amended pleading by April 18, 1994. His amended motion for judgment was filed on April 26, 1994.) The allegations in the amended motion for judgment were substantially the same as those alleged in the original motion for judgment. Using slightly different phraseology, the new pleading again asserted fraud, self-dealing, false testimony in previous proceedings, and breach of fiduciary duties. The prayers for relief sought an avoidance of the foreclosure and compensatory and punitive damages. The defendants filed another demurrer. After another hearing, the court dismissed Sherry Gillis as a party defendant, sustained the demurrer “in all respects,” and dismissed the action. The final order, from which no appeal was taken, was entered on May 31, 1994.
The Doctrine of Res Judicata
Res judicata is the well-established judicially-crafted doctrine that holds that a person shall not litigate a second time with the same person any question, controversy or issue that has been finally determined upon the merits, by a court of competent jurisdiction, in a former suit. To sustain a plea of res judicata, it is necessary to show that the parties are the same, the issue is the same, and the issue has been decided on its merits by a court of competent jurisdiction. In other words, the doctrine is applied in situations where there has been a determination of a particular question in a case once decided and it is sought to retry the same in another proceeding. The doctrine applies to all matters that existed at the time of the prior judgment or decree and which the parties had the opportunity of bringing before the court. Thus, it is not always necessary that the matter should have been formally put in issue. See 8B M.J., Former Adjudication or Res Judicata, § 49. It is said that the doctrine is founded upon two maxims: one, a person should not be twice vexed for the same cause, and, two, it is for the public good that there be an end to litigation. See, generally, 8B M.J., Former Adjudication or Res Judicata, § 2 et seq.
Decision
Applying the principles explained above to the circumstances of this litigation, the court reaches the following conclusions:
*73The adjudication in Case # 1 does not bar this suit. That unlawful detainer case predated the foreclosure; therefore, the charges Lux makes in this case — fraud, breach of fiduciary duty, self-dealing, etc., related to the foreclosure — could not have been the subjects of controversy in that case.
Similarly, most of the adjudications in the bankruptcy case(s) predated the foreclosure and, hence, could not have addressed the same matters raised here. It is not clear from the record whether the bankruptcy proceedings that took place after the foreclosure concerned the validity of the foreclosure or merely dealt with the appropriateness of that court to decide that issue in those proceedings. Because it is incumbent on the party that pleads res judicata to identify the issues in the former case, this court is of the opinion that no satisfactory showing has been made that the rulings of the bankruptcy court constitute a bar to the claims made here.
The adjudication in Case # 3 granted Spotswood possession of the property it had purchased at foreclosure. Damages sustained by Spotswood, loss of rental value during the several appeals, were awarded by the court from the appeals bonds posted by Lux. It is inconceivable that Lux did not raise the issues of fraud, breach of fiduciary duty, and self-dealing in his defense in that case. However, because the case originated in the general district court, the record is inadequate. This court cannot ascertain from the record whether the final decision in that case bars the claims asserted by Lux in this case.
Lux nonsuited the chancery suit he filed in 1992 (Case # 4) before final adjudication. A judgment of nonsuit does not operate as a bar to a subsequent suit for the same cause. 9B M.J., Former Adjudication or Res Judicata, § 58. See also, Virginia Code § 8.01-380. (Lux did not recommence that suit within the statutory six-month grace period. Whether the period of limitations has run, or laches applies, is a matter that the court has expressly reserved for another day, if necessary.)
The law action commenced by Lux in 1993 (Case # 5) involved the same parties as in this suit, except that Sherry Gillis, an employee of Spotswood, was named as an additional defendant in that case. She was dismissed as a party defendant. In any event, the fact that she was a defendant in the former case is of no consequence. Spotswood and the trustees, defendants here, also were defendants in that case, and it is their plea of res judicata that is being considered.
The 1993 law action also involved the same issues as those raised here. Although the allegations may have been phrased somewhat differently, it *74is dear that Lux was asserting the same facts, making the same claims, seeking the same relief, and raising the same issues as those asserted in this suit.
The key question is whether the 1993 action was decided on the merits.
As explained above, that litigation concluded when the court sustained the defendants’ demurrer to Lux’s amended motion for judgment by “Final Order” dated May 31, 1994. That order is final; no appeal was taken.
Although the defendants filed other motions and pleas in conjunction with their demurrer, the court ruled on the demurrer and sustained it in all respects. In their demurrer, the defendants contended that the facts alleged by Lux and the claims made by Lux, even if true, did not state a cause of action upon which Lux could recover damages or avoid the foreclosure as prayed for in the pleadings.
Generally, a decision upon a demurrer, though it is an order dismissing the plaintiff’s pleading, will be conclusive, provided that such matters were necessarily in controversy in the case and were decided on it. Stated differently, a demurrer which denies the right of the plaintiff to recover on the cause of action alleged, which is sustained, is a decision on the merits. See, generally, 8B M.J., Former Adjudication or Res Judicata, § 61.
In Gimbert v. Norfolk Southern RR. Co., 152 Va. 684 (1929), the plaintiff sued for injuries he had sustained as a child. During infancy, he, by his next friend, had instituted an action against the same defendant for the same injuries. In the former case, the defendant had demurred on the ground that the plaintiff’s pleading did not show fault on the part of the defendant and, hence, failed to sufficiently state a cause of action. The court sustained the demurrer with leave to amend. The plaintiff failed to amend, and the case was dismissed. In the instant case, the defendant filed a plea of res judicata based on the outcome on demurrer in the former action. The Court held that “a decision of an issue of law on a demurrer is a decision on the merits and constitutes res judicata as to any other proceedings where the same parties and the same issues are involved.”
The question arose again in Griffin v. Griffin, 183 Va. 443 (1945). There, a wife had filed for divorce on the ground of cruelty. The court sustained a demurrer to the bill and granted leave to amend. The wife did not amend her bill, and the suit was dismissed. A year later, the wife filed the instant suit, seeking a divorce on the same ground, based substantially on the same facts as in the former suit. The husband filed a plea of res judicata, which the trial court sustained. The Virginia Supreme Court, citing Gimbert and other authorities, affirmed.
*75First, the Griffin case noted that the allegations in the instant case were not precisely the same as or identical to the allegations in the former suit. Nevertheless, there was no substantial difference, and so the causes of action were the same for purposes of res judicata.
Next, the court pointed out that in Virginia, a demurrer cannot go to defects and errors of form or immaterial matters. Instead, a demurrer “must go to the heart of the cause, and if it is sustained, it is a decision on the merits of the cause.”
The statute cited by the Court in Griffin remains in effect. Virginia Code § 8.01-275 provides that demurrers as to form are abolished where the pleading sets forth sufficient matter of substance for the court to proceed upon the merits of the case. The statute states that a demurrer should be sustained only where there is the omission of something so essential to the action that judgment, according to law and the very right of the cause, cannot be given. See also, Va. Code § 8.01-273.
Therefore, in the 1993 action brought by Lux and dismissed upon a second demurrer, the court could not have terminated the case for matters of form or because of some insignificant defect in Lux’s pleading. Instead, the court considered the specific grounds set forth in the demurrer and determined that the facts alleged, even if proven, did not state a cause of action against the defendants and that Lux could not recover judgment, according to law and the very right of the cause, on the claims made.
For these reasons, the court is of the opinion that the merits of Lux’s cause, as that term is used in the doctrine of res judicata, were decided in the 1993 law action.
Finally, Lux contends that the 1993 law action cannot bar the claims asserted in this case because the former case was brought on the law side of the court, whereas it should have been in chancery, as this one is. It follows, Lux argues, that the court did not have jurisdiction in the 1993 law action to grant the relief sought.
The argument is without merit. This court had jurisdiction in 1993 to set aside the foreclosure, to award damages, and to grant the other relief sought by Lux. The fact that a case is filed on the wrong side of the court does not mean that that court is not a “court of competent jurisdiction.” In fact, the court would be statutorily precluded from dismissing the case under such circumstances. Virginia Code § 8.01-270 specifically provides that no case shall be dismissed simply because it was brought on the wrong side of the court but shall be transferred to the proper side.
*76Interestingly, the defendants filed a motion for transfer in the 1993 law action, suggesting that the case was on the wrong side of the court because Lux was seeking equitable relief (avoidance of the foreclosure) as well as damages. Nonetheless, as we have seen, the court ruled on the demurrer, which went to the merits of the case, and sustained it “in all respects.” In essence, the court decided that the claims asserted by Lux did not sufficiently state a cause of action no matter on which side of the court they belonged.
Conclusion
The claims asserted in this suit involve the same issues raised and adjudicated by demurrer and final order in the 1993 litigation between the same parties. Thus, the defendants’ plea of res judicata is well taken and will be sustained. It is unnecessary to move forward with the demurrer and other motions and pleas filed by the defendants because the suit will be dismissed with prejudice.
The reason for the doctrine of res judicata, explained in a quotation in Griffin, supra, is particularly appropriate here:
The doctrine of res judicata may be said to inhere in the legal systems of all civilized nations as an obvious rule of expediency, justice, and public tranquility. Public policy and the interest of litigants alike require that there be an end to litigation which, without the doctrine of res judicata, would be endless. The doctrine of res judicata rests upon the ground that the party ... has litigated or had an opportunity to litigate the same matter in a former action in a court of competent jurisdiction and should not be permitted to litigate it again to the harassment and vexation of his opponent. The doctrine of res judicata not only puts an end to strife but produces certainty as to individual rights and gives dignity and respect to judicial proceedings ....