
16 Cal.2d 516 (1940)
THE BANK OF CALIFORNIA, NATIONAL ASSOCIATION (a National Banking Association), as Executor, etc., et al., Petitioners,
v.
THE SUPERIOR COURT OF THE CITY AND COUNTY OF SAN FRANCISCO et al., Respondents.
S. F. No. 16436. 
Supreme Court of California. In Bank.  
November 7, 1940.
 Pillsbury, Madison & Sutro, Myrick, Deering & Scott and James Walter Scott for Petitioners.
 Mitchell Bourquin, Clinton L. Markley, George H. Cabaniss, Jr., and Daniel R. Shoemaker for Respondents.
 GIBSON, C.J.
 This is a petition for a writ of prohibition, to restrain the respondent superior court from proceeding with the trial of an action without bringing in certain parties alleged to be "necessary and indispensable".
 Sara M. Boyd, the widow of Colin M. Boyd, died testate in June, 1937, leaving an estate valued at about $225,000. On July 8, 1937, in the superior court in San Francisco, her will was admitted to probate, and petitioner, Bank of California, was appointed executor. The will left individual legacies and bequests amounting to $60,000 to a large number of legatees, including charitable institutions and individuals, some residing in other states and in foreign countries. Petitioner, St. Luke's Hospital, was named residuary legatee and devisee, and thereby received the bulk of the estate. *519
 On October 14, 1937, Bertha M. Smedley, a niece and legatee, brought an action to enforce the provisions of an alleged contract by which decedent agreed to leave her entire estate to the plaintiff. The complaint named as parties defendant the executor and all of the beneficiaries under the will, and prayed for a decree adjudging that plaintiff is, by virtue of the agreement, the owner of the entire estate of the decedent after payment of debts and expenses. It was further prayed that plaintiff's title to the property be quieted; that defendants be ordered to execute deeds to her, and that upon the failure of any defendant to do so the clerk should execute such an instrument.
 Summons was served only upon petitioners, the executor and the residuary legatee. No other defendants were served, and none appeared. Petitioners filed separate answers. The action came to trial on November 15, 1939. Immediately upon its opening, petitioners made a motion under section 389 of the Code of Civil Procedure for an order to bring in the other defendants, and to have summons issued and served upon them. The motion was made on the ground that all the other defendants were "necessary and indispensable parties" to the action, and that the court could not proceed without them. The motion was denied by respondent court. Petitioners then applied for a writ of prohibition to restrain the trial until these other parties should be brought in.
 In support of their application, petitioners point out that the complaint challenges the right of every legatee and devisee to share in the estate, and prays for an award of the entire property to plaintiff. It is contended that a trial and judgment without the absent defendants would adversely affect the rights of such parties, would result in a multiplicity of suits, and would subject the petitioning executor to inconvenience, expense and the burden of future litigation.
 [1] To test the theory of petitioners, it will be necessary to examine briefly the origin and nature of the rules on required or compulsory joinder of parties. We may eliminate, at the outset, the field of permissive joinder of "proper parties", for there is no doubt that the absent defendants are interested in the issues and subject of the action, and could properly be joined. For the same reason, these legatees, if they had not been named as defendants, could no doubt have intervened in the action. These propositions are *520 conceded by all parties, and the precise issue is thus made clear, whether the absent defendants are not only proper parties but "indispensable parties" in the sense that service upon them or their appearance is essential to the jurisdiction of the court to proceed in the action. [2] Prohibition, of course, cannot issue unless the procedural defect of parties is jurisdictional. (See Morrow v. Superior Court, 9 Cal.App.2d 16, 26, infra [48 PaCal.2d 188, 50 PaCal.2d 66].)
 At common law, joinder of plaintiffs was compulsory where the parties, under the substantive law, were possessed of joint rights. Joint promisees under a contract, partners, and joint tenants were familiar examples. [3] Equity courts developed another theory of compulsory joinder, to carry out the policy of avoiding piecemeal litigation and multiplicity of suits. Those persons necessary to a complete settlement of the controversy were usually required to be joined, in order that the entire matter might be concluded by a single suit. Obviously, this theory of joinder covered many situations where the substantive rights were not joint, and accordingly joinder would not have been required in an action at law. (See Clark, Code Pleading, pp. 241, 242, 245.) Generally speaking, the modern rule under the codes carries out the established equity doctrine. Thus, section 389 of the Code of Civil Procedure states: "The court may determine any controversy between parties before it, when it can be done without prejudice to the rights of others, or by saving their rights; but when a complete determination of the controversy cannot be had without the presence of other parties, the court must then order them to be brought in. ..." Such statutes have been interpreted as declaratory of the equity rule and practice. (See Clark, Code Pleading, p. 250; Ambassador Petroleum Co. v. Superior Court, 208 Cal. 667, 671 [284 P. 445]; Mitau v. Roddan, 149 Cal. 1, 7 [84 P. 145, 6 L.R.A. (N. S.) 275]; Solomon v. Redona, 52 Cal.App. 300, 306 [198 P. 643].)
 But the equity doctrine as developed by the courts is loose and ambiguous in its expression and uncertain in its application. Sometimes it is stated as a mandatory rule, and at other times as a matter of discretion, designed to reach an equitable result if it is practicable to do so. And despite various attempts at reconciliation of conflicting expressions (see, e. g., Ambassador Petroleum Co. v. Superior Court, *521 supra), a great deal of confusion still remains in the cases. (See notes, 48 Harv. L. Rev. 995; 23 Cal. L. Rev. 320, 321.) Bearing in mind the fundamental purpose of the doctrine, we should, in dealing with "necessary" and "indispensable" parties, be careful to avoid converting a discretionary power or a rule of fairness in procedure into an arbitrary and burdensome requirement which may thwart rather than accomplish justice. [4] These two terms have frequently been coupled together as if they have the same meaning; but there appears to be a sound distinction, both in theory and practice, between parties deemed "indispensable" and those considered merely "necessary". As Professor Clark has remarked: "It has been objected that the terms 'necessary' and 'indispensable' convey the same idea ... But a distinction has been drawn. While necessary parties are so interested in the controversy that they should normally be made parties in order to enable the court to do complete justice, yet if their interests are separable from the rest and particularly where their presence in the suit cannot be obtained, they are not indispensable parties. The latter are those without whom the court cannot proceed." (Clark, Code Pleading, p. 245, note 21.) (See, also, as to the distinction in the federal courts, Franz v. Buder, 11 Fed.2d 854, 856; Atwood v. Rhode Island Hosp. Trust Co., 275 Fed. 513 [24 A.L.R. 156].)
 First, then, what parties are indispensable? There may be some persons whose interests, rights, or duties will inevitably be affected by any decree which can be rendered in the action. Typical are the situations where a number of persons have undetermined interests in the same property, or in a particular trust fund, and one of them seeks, in an action, to recover the whole, to fix his share, or to recover a portion claimed by him. The other persons with similar interests are indispensable parties. The reason is that a judgment in favor of one claimant for part of the property or fund would necessarily determine the amount or extent which remains available to the others. Hence, any judgment in the action would inevitably affect their rights. Thus, in an action by one creditor against assignees for the benefit of creditors, seeking an accounting and payment of his share of the assets, the other creditors were held indispensable (McPherson v. Parker, 30 Cal. 455 [89 Am. Dec. 129]); and in an action *522 by plaintiff to enforce a trust, where he claimed the property in his own right, to the exclusion of another actual beneficiary, failure to join the latter was held fatal to the judgment. (O'Connor v. Irvine, 74 Cal. 435 [16 P. 236].) Where, also, the plaintiff seeks some other type of affirmative relief which, if granted, would injure or affect the interests of a third person not joined, that third person is an indispensable party. Thus, in an action by a lessor against a sublessee to forfeit a parent lease because of acts of the sublessee, the sublessors (original lessees) were indispensable parties, since a decree of forfeiture would deprive them of their lease. (Hartman Ranch Co. v. Associated Oil Co., 10 Cal.2d 232, 262 [73 PaCal.2d 1163].) And in a suit to cancel illegal registration of voters, all voters whose registration was challenged were indispensable parties. (Ash v. Superior Court, 33 Cal.App. 800 [166 P. 841].) Many other cases, illustrating the reasons for compulsory joinder, may be found. (See, e. g., Mitau v. Roddan, supra; Crowell v. Cape Cod Ship Canal Co., 164 Mass. 235 [41 N.E. 290]; Lawrence v. Smith, 201 Mass. 214 [87 N.E. 623]; Florida Land Rock Phosphate Co. v. Anderson, 50 Fla. 501 [39 So. 392, 396]; Hartley v. Langkamp, 243 Pa. 550 [90 Atl. 402]; Fineman v. Cutler, 273 Pa. 189 [116 Atl. 819]; Matagorda Canal Co. v. Markham Irr. Co., [Tex. Civ. App.] 154 S.W. 1176; Franz v. Buder, supra; Weeden v. Gher, 316 Ill. 534 [147 N.E. 388]; Hauser v. Power, 351 Ill. 36 [183 N.E. 580]; notes, 48 Harv. L. Rev. 995; 23 Cal. L. Rev. 320, 340.)
 All of these persons are, of course, "necessary" parties, but the decisions show that they come within a special classification of necessary parties, to which the term "indispensable" seems appropriate. An attempt to adjudicate their rights without joinder is futile. Many cases go so far as to say that the court would have no jurisdiction to proceed without them, and that its purported judgment would be void and subject to collateral attack. [5] The objection being so fundamental, it need not be raised by the parties themselves; the court may, of its own motion, dismiss the proceedings, or refuse to proceed, until these indispensable parties are brought in. (Hartman Ranch Co. v. Associated Oil Co., supra; Solomon v. Redona, 52 Cal.App. 300 [198 P. 643]; Hutchins v. Security Trust etc. Bank, 208 Cal. 463, 467 [281 P. 1026, 65 A.L.R. 1059]; Florida Land Rock Phosphate *523 Co. v. Anderson; supra; Hartley v. Langkamp, supra; Krueding v. Chicago Dock & Canal Co., 285 Ill. 79 [120 N.E. 478]; Hauser v. Power, supra; Fineman v. Cutler, supra.) [6] It follows that if the court does attempt to proceed, it is acting beyond its jurisdiction and may be restrained by prohibition.
 [7] The other classification includes persons who are interested in the sense that they might possibly be affected by the decision, or whose interests in the subject matter or transaction are such that it cannot be finally and completely settled without them; but nevertheless their interests are so separable that a decree may be rendered between the parties before the court without affecting those others. These latter may perhaps be "necessary" parties to a complete settlement of the entire controversy or transaction, but are not "indispensable" to any valid judgment in the particular case. [8] They should normally be joined, and the court, following the equity rule, will usually require them to be joined, in order to carry out the policy of complete determination and avoidance of multiplicity of suits. But, since the rule itself is one of equity, it is limited and qualified by considerations of fairness, convenience, and practicability. Where, for example, it is impossible to find these other persons or impracticable to bring them in, the action may proceed as to those parties who are present.
 Thus, in Ambassador Petroleum Co. v. Superior Court, supra, a proceeding by the state against lessees operating oil wells, to prevent waste of natural gas, the lessors were held not to be indispensable parties; and in Morrow v. Superior Court, 9 Cal.App.2d 16, 26 [48 PaCal.2d 188, 50 PaCal.2d 66], the court refused to order another interested person brought in as a defendant where to do so might constitute an interference with the jurisdiction of the federal court over a different action to which he was a party. (See, also, London etc. Bank v. Smith, 101 Cal. 415, 421-423 [35 P. 1027]; Rundell v. McDonald, 62 Cal.App. 721, 728, infra [217 P. 1082]; Clark, Code Pleading, p. 246; 48 Harv. L. Rev. 995, 999.) In Morrow v. Superior Court, supra, where a writ of prohibition to restrain the trial pending the bringing in of the new party was refused, this court said, in denying a hearing: "The action is simply one to determine adverse claims as between the plaintiff and the named defendants. *524 While in such an action additional parties ordinarily may be brought in so as to include a settlement of their adverse claims, it is not our view that the controversy now before the court between the original parties may not be determined without prejudice to the rights of the oil company. Certainly those rights might be determined and the decree so drawn that it will save the rights, if any, of the excluded party. On the facts appearing, the question is not one of jurisdiction, and the court has jurisdiction to proceed without bringing in such party if in its discretion it shall decide upon that as the proper course."
 [9] With the foregoing distinctions in mind, the present action may be examined to determine whether the absent defendants are indispensable or only necessary parties. The nature of such an action has been frequently discussed by the courts. The probate court cannot, of course, take cognizance of the contract, and an equity court cannot compel the making of a will. Hence, there is no specific performance of the contract in the strict sense. But equity gives relief which is the equivalent of specific performance. Though the estate may be probated and the property distributed accordingly, the court will, in an action by the promisee, impose a constructive trust upon any particular property in the hands of the individual distributee. This relief is sometimes called "quasi specific performance", since it accomplishes the substantial result of enforcement of the contract. (See Notten v. Mensing, 3 Cal.2d 469, 473 [45 PaCal.2d 198, 200]; Rundell v. McDonald, 62 Cal.App. 721, 728 [217 P. 1082]; Atkinson on Wills, p. 172.)
 [10] The action in these cases is against the distributee personally, and not against the estate; and it is independent of the will and the probate proceeding. Each distributee is individually held as a constructive trustee solely of the property which came to him, and none is interested in the granting or denial of similar relief as to any other. Where there are a number of legatees and devisees, they would all appear to be "necessary" parties in the sense that the main issue, the validity of the testamentary disposition of the property of decedent, affects their property interests, and the entire matter, the disposition of all of the decedent's property, cannot be finally settled without a binding adjudication for or against every legatee or devisee. Hence, the court will *525 usually order them served and brought in unless there is some good reason for not doing so. But the absent defendants in such a case are not indispensable parties. Unlike the situations discussed above, in which any judgment would necessarily affect the rights of the absent persons, the case here is one where plaintiff may litigate her claim against the appearing defendants alone and obtain a decree which binds them alone. The absent defendants, not being before the court, will not be bound by the judgment, whether favorable or unfavorable, and their property interests will not be affected.
 This analysis finds complete support in the well-considered case of Rundell v. McDonald, supra, where all of the heirs of the intestate were named as defendants, but the action was dismissed as to some of them. The court said (p. 728): "If, on the other hand, as appellant contends, an action such as this can be maintained only against the heirs, appellant nevertheless is in no position to complain of any defect of parties defendant, since the decree cannot injudiciously affect the other heirs. Though the heirs succeeded to the legal title as tenants in common, they held their respective undivided moieties by several and distinct titles ... The theory on which the courts proceed, therefore, is to fasten a trust on the property in favor of the promisee, and to enforce such trust against the heirs of the deceased. Under this theory each heir holds the title to which he has succeeded in trust for the promisee. In the instant case the effect of the judgment against appellant as the surviving husband was to fasten a trust on the title to which he succeeded and to compel a conveyance of that title to respondent. If, as appellant contends, an action such as this lies only against the heirs of the deceased promisor and not against his estate or personal representative, then the judgment cannot be pleaded against any of the heirs as to whom the action was dismissed. It follows, therefore, that the decree in nowise affects the rights of appellant's coheirs, and that they were not indispensable parties to the action." (See, also, to the same effect, Oles v. Wilson, 57 Colo. 246 [141 P. 489, 498].)
 If, in this kind of action, the court has jurisdiction to try the case, and may render a valid judgment where the plaintiff sues or maintains the suit against less than all of the distributees, it must be clear that they are not indispensable *526 parties. So, in the present case, the absent defendants are not indispensable parties, and the court has jurisdiction to proceed without them, to determine the rights of the parties actually before it.
 [11, 12] Much stress is laid by petitioners upon the fact that plaintiff prays for judgment against all the defendants, and has not dismissed as to the absent parties. It is also pointed out that the prayer seeks a decree quieting title to the property. Petitioners argue that the court cannot have jurisdiction over the action in the form in which plaintiff seeks to maintain it, without bringing in the absent parties. The answer to this contention is that the court cannot lose jurisdiction of a proceeding merely because the prayer of the complaint seeks relief beyond that to which the plaintiff is entitled. The court may try the matters within its jurisdiction and render a valid judgment. It is not bound to follow plaintiff's theory and certainly it will not be presumed that it will follow an erroneous theory and act beyond its jurisdiction.
 [13] Only brief mention need be made of the contention that the prosecution of the action against less than all of the distributees will cause inconvenience and multiplicity of suits to the injury of the executor. These are all matters within the discretion of the court to consider in connection with its policy to settle the entire controversy in one proceeding, if possible. But the contention, as we have seen, does not go to the jurisdiction of the court.
 [14] We have refrained from discussing the question whether the lower court's denial of the motion to bring in the absent defendants was, under the circumstances, an abuse of discretion. If they were readily available and could have been brought in without serious difficulty, it may well be that the motion should have been granted. On the other hand, if, as is asserted by respondents, many reside outside the state or the country, great difficulty might be encountered in any attempt to bring them in, and the trial might be indefinitely delayed, to the detriment of the present parties. The fact that the interests of the absent defendants are trivial as compared with that of the residuary legatee, which received over seventy-five percent of the estate, is perhaps some indication of the reason why plaintiff chose to go to trial against the latter alone. All these considerations, however, *527 were for the trial court in the first instance, and its determination, though reviewable in the proper manner, cannot be attacked on an application for writ of prohibition.
 The alternative writ, heretofore issued is discharged, and the peremptory writ is denied.
 Edmonds, J., Curtis, J., Carter, J., Shenk, J., Moore, J., pro tem., and York, J., pro tem., concurred.
