
239 Kan. 165 (1986)
718 P.2d 292
THE HOME STATE BANK, Appellee,
v.
P.B. HOIDALE CO., INC., Appellant.
No. 57,658
Supreme Court of Kansas.
Opinion filed May 2, 1986.
Stephen J. Bednar, of Wichita, argued the cause and was on the briefs for appellant.
Michael S. Holland, of Russell, argued the cause and was on the brief for appellee.
The opinion of the court was delivered by
MILLER, J.:
The plaintiff, Home State Bank, commenced this action to foreclose its mortgages. Joined as defendants were the mortgagor, Save-Time Stores, Inc., as well as P.B. Hoidale Company and others who had filed mechanics' liens against the realty. The trial court held that two of the Bank's mortgages were purchase money mortgages and thus superior to Hoidale's mechanic's lien. Hoidale appeals.
We will first give a chronological statement of the facts. In May 1982, Save-Time Stores, Inc., gave a mortgage to the Home State Bank on certain Russell County real estate. In August, Save-Time gave a second mortgage to the Bank, and later that month it gave the Bank a third mortgage. The Bank did not record the mortgages promptly. On November 11, 1982, Hoidale contracted with Save-Time Stores to furnish material and perform labor on the premises. Hoidale last performed labor and furnished materials on January 11, 1983. On April 4, Hoidale filed its mechanic's lien in Russell County for $10,132.11. On April 21, Hoidale filed suit in Sedgwick County against Save-Time for $10,132.11. It did not seek foreclosure of its mechanic's lien in that action. On May 5, Hoidale sent a copy of the petition filed in *166 Sedgwick County to the Clerk of the Russell County District Court for lis pendens purposes. For reasons not here important, that action was ineffective (see K.S.A. 60-2203a).
On May 13, 1983, the Bank finally recorded its three mortgages in the office of the Russell County Register of Deeds, and on June 16 it filed this action in Russell County District Court against Save-Time, Hoidale, and others to foreclose its mortgages. In July, Hoidale filed an answer, asking for foreclosure of its mechanic's lien in the amount of $55,000. It claimed priority over the Bank's mortgages. The amount Hoidale sought was later reduced to $10,132.11 during pretrial.
In August 1983, Hoidale filed a separate suit in Russell County against Save-Time Stores to recover the same $10,132.11. No lien foreclosure was sought. On September 1, judgment was entered in the Sedgwick County action in favor of Hoidale and against Save-Time Stores for $10,132.11, together with other relief. On September 9, Hoidale secured a judgment in its Russell County action against Save-Time Stores for $10,132.11. The mechanic's lien was not mentioned and was not foreclosed by either of those two judgments.
On December 1, 1983, the instant action came on before the trial court for pretrial conference. The matter was submitted to the court for decision and both parties later filed memorandum briefs.
On September 7, 1984, the trial court filed its memorandum decision and directed counsel to prepare a journal entry. The journal entry was filed October 31, 1984. The trial court held that the first two of the Bank's mortgages were purchase money mortgages and as such they were prior to Hoidale's mechanic's lien by virtue of K.S.A. 58-2305. The court held that the Bank's third mortgage was not a purchase money mortgage. The court determined that the Bank's purchase money mortgages were first and prior liens, followed by Hoidale's mechanic's lien, followed by the Bank's third mortgage, followed in order by the claims of other lien holders with whom we are not concerned. The court ordered sale of the real estate and, from the proceeds, payment of taxes and costs, and then the lien interests of the parties in the order stated. Hoidale appeals.
The controlling issue is raised by appellee: Whether defendant Hoidale, having elected to pursue its claim for a personal *167 judgment only against Save-Time Stores, and having recovered two identical judgments against Save-Time Stores without foreclosing its mechanic's lien, should be permitted in this third action to foreclose its lien. We are persuaded that it should not.
Kearny County Bank v. Nunn, 156 Kan. 563, 134 P.2d 635 (1943), was an action on a promissory note given by Nunn to the Bank. The Bank, in a separate suit, had already secured a judgment of foreclosure on the real estate mortgage given to secure the note. We held that an answer setting up the judgment in the earlier lawsuit presented a valid defense to the Bank's suit on the note. We said:
"The rule prohibiting the splitting of a cause of action has always had the approval of this court and is well established in Kansas. (Todd v. Central Petroleum Co., 155 Kan. 249, 124 P.2d 704; Anspaugh v. Dougherty, 153 Kan. 257, 109 P.2d 101; Krueger v. Schlemeyer, 145 Kan. 469, 66 P.2d 395; First Nat'l Bank v. Schruben, 125 Kan. 417, 265 Pac. 53; Thisler v. Miller, 53 Kan. 515, 36 Pac. 1060; Coal Co. v. Brick Co., 52 Kan. 747, 35 Pac. 810; W. & W. Rld. Co. v. Beebe, 39 Kan. 465, 18 Pac. 502.)
"The purpose of the rule is to protect a defendant against a multiplicity of suits on a single cause of action. The rule and the reason for its existence are well illustrated in the instant situation where the creditor, having a single cause of action on his note and mortgage, and the opportunity to take judgment on both, elected to disregard the note and merely foreclose the mortgage, with the expectation that at some later date, in another action, he would obtain a judgment in personam upon the primary obligation, without which the mortgage would never have been executed.
"That the defense of res judicata, as set forth in appellant's answer is available to him would seem to be established by the decisions of this court. It has been repeatedly held that when all parties are in court, and the court has full jurisdiction of the subject matter and parties and could determine all issues properly involved, all such issues should then be determined, and that not only do the matters which are then expressly determined but also all other matters which might and should have been then determined become res judicata and are not available to the parties in a future action." 156 Kan. at 565.
The Kearny rationale was followed by the United States District Court in In re Wilson, 390 F. Supp. 1121 (D. Kan. 1975), where Liberty Loan, the holder of a note secured by a perfected security interest, brought suit on the note without attempting to replevin or foreclose on the collateral. It obtained an in personam judgment against the debtor. Several months later the debtor took bankruptcy and Liberty Loan sought secured creditor status in the bankruptcy proceedings. The Referee in Bankruptcy ordered that Liberty Loan be treated as an unsecured creditor and the district court affirmed, saying:

*168 "The Referee's decision on the first question, i.e., that Liberty Loan lost its security interest when it obtained a judgment on the debtor, relies on the authority of Matter of Downey, No. 8726-B-2, decided by Chief Judge Wesley E. Brown of this district in 1964. The facts in the Downey case were substantially similar to those involved in the present action. There, the creditor held the debtor's promissory note secured by a chattel mortgage. When the debt became delinquent, the creditor obtained a judgment in the state court on the note only. No attempt was made to foreclose on the chattel mortgage. Chapter XIII proceedings were subsequently commenced and the creditor registered a claim as a secured party. The Trustee objected, claiming that the creditor was merely an unsecured creditor. The Referee upheld the objection and on appeal to the United States District Court, the Referee's decision was affirmed. The District Court held that since the creditor could have sought foreclosure on his chattel mortgage at the same time he brought the action on the note, he was precluded, under the principles of res judicata, from resorting to that chattel mortgage.
"The rule announced in the Downey case is illuminated by an examination of the Kansas case law upon which it was based. The Downey decision is a logical extension of the decision by the Kansas Supreme Court in Kearny v. Nunn, 156 Kan. 563, 134 P.2d 635 (1943), which was an in personam action on a note secured by a real estate mortgage. The defendant filed an answer alleging that in a former action the owner of the note had obtained a judgment in rem foreclosing the mortgage without seeking an in personam judgment on the note. The Kansas Supreme Court, noting that the maker of the note was a party to the former action foreclosing the mortgage, and an in personam action could have been brought at that time, held that the answer stated a valid defense under the doctrine of res judicata and the rule prohibiting splitting a cause of action. The res judicata rule relied upon by the Court is stated in the opinion as follows:
"`It has been repeatedly held that when all parties are in court, and the court has full jurisdiction of the subject matter and partius and could determine all issues properly involved, all such issues should be then determined, and that not only do the matters which are then expressly determined but also all other matters which might and should have been then determined becomes [sic] res judicata and are not available to the parties in a future action.' Id. 156 Kan. at 565, 134 P.2d at 636.
"The Court further noted in the Kearny case that its previous decision in Rossiter v. Merriman, 80 Kan. 739, 104 P. 858 (1909), has been abrogated by later decisions which condemn the splitting of causes of action and broadly apply the doctrine of res judicata. In Rossiter the Court recognized that when an action is brought on the note and a judgment is obtained, the note becomes merged in the judgment and cannot be made the basis for a subsequent action. The Court added, however, that a mortgage which secured the note remains in effect as security for the judgment and may be asserted to enforce the judgment.
"By its decision in Kearny, and the further statement that the Rossiter decision is abrogated by later decisions, the Kansas Supreme Court indicates that under the principles of res judicata, when a creditor brings either an action on a note or an action to foreclose a real estate mortgage securing that note, he has spent his one opportunity to judicially enforce the obligation. If the creditor first forecloses on the mortgage, he is precluded from bringing a subsequent action to obtain an *169 in personam judgment on the note, and if he first obtains an in personam judgment, he is precluded from bringing a subsequent action to foreclose the mortgage. If the creditor wishes to both foreclose the mortgage and obtain an in personam judgment, he must assert both claims in a single action." (Emphasis supplied.) 390 F. Supp. at 1123-24.
The rule against the splitting of a cause of action is based upon varied and justifiable concerns: preserving judicial economy and convenience; avoiding repetitive or fragmented litigation; and protecting a party from multiple harassment and expense over the same claim. Here we can see no reason for three separate lawsuits. Hoidale could have sought both a personal judgment against Save-Time Stores and the foreclosure of its mechanic's lien in a single Russell County action.
Because Hoidale reduced its claim against the debtor to personal judgments before the foreclosure claim in this third action came on for decision, we hold that Hoidale waived its right to foreclose its lien. If a mechanic's lien holder wishes to secure a personal judgment against the owner and to foreclose its mechanic's lien, it should do so in the same action.
We have not overlooked the numerous authorities from other jurisdictions cited by appellant, which hold that foreclosure is merely a cumulative remedy and may be pursued independently of the personal claim, but we find them contrary to Kansas law as stated in the cases already discussed.
Also, we have not overlooked Hoidale's argument that the Bank is not entitled to rely upon the doctrine of res judicata because it was not a party to the lawsuits in which Hoidale secured personal judgments against Save-Time Stores. We rely not upon that doctrine, but upon the rule against the splitting of a cause of action as set forth above.
Finally, we do not reach Hoidale's contention that the Bank's mortgages come within the provisions of the Kansas recording acts, K.S.A. 58-2222 and 58-2223, and being unrecorded for so many months do not have priority over subsequently arising and perfected mechanics' liens. We have doubt about the priority of unrecorded mortgages, but we do not decide the issue. Hoidale has waived its right to enforce its lien. Its judgment in Russell County is effective only from the date on which its suit was filed, August 5, 1983; therefore, Hoidale's judgment lien is subsequent to the recording of the Bank's mortgage. See K.S.A. 1985 Supp. 60-2202(a).
*170 For the reasons stated, the judgment of the district court foreclosing the mechanic's lien of P.B. Hoidale Company, Inc., is reversed.
