This is an action to adjudicate the rights of a large number of alleged appropriators of water from Big Wood river, a stream flowing through Blaine and Lincoln counties, this state. There are some twenty or more plaintiffs, and several hundred defendants. A referee was appointed by the court and the evidence taken, and after the close of the evidence the plaintiffs, by their attorneys, made an application to the court to make the Idaho Irrigation Company, Ltd., and J. G. White & Co. parties to the action. This application was based upon the affidavit of J. H. Hawley, one of counsel for the plaintiffs.
This affidavit, among other things, recites that the evidence in said eause has been taken by the referee, and that the taking of such evidence has not yet been completed, but that said cause is still open for the admission of other and further evidence; that the Idaho Irrigation Company, Ltd., is a corporation organized under the laws of the state of Idaho, and that the articles of incorporation of said company were filed in the office of the secretary of state on or about the 22d day of December, 1905, and that said corporation was not in existence at the time of the commencement of the action; that on information and belief the Idaho Irrigation Company, Ltd., claims some right to the water and use of the water involved in this controversy, the extent and amount of said rights being to affiant unknown; but all of the rights of said corporation are inferior in right to that of each of the parties or the answering defendants herein; that J. G. White & Co. is a corporation, organized and existing under the laws of the state of Connecticut, and doing business in Lincoln and Blaine counties, in this state, and is engaged in the construction of dams, impounding the waters of said Big Wood river, and is acting in conjunction with the Idaho Irrigation *377Company in the construction of said dams and impounding said waters, and in the construction of works for the purpose of storing and diverting the waters of said stream sought to be litigated in this action; that said defendants have not been made parties to said suit, and are not only claiming the use and the right to the use of the waters herein being litigated, but are also impounding the waters of said Big Wood river, and diverting the waters of said stream so impounded, and thereby obstructing the flow of the waters of said stream to the injury of the plaintiffs and defendants; that affiant is of the opinion and judgment, as an attorney of this court, that the complete determination of the controversy herein, and of the rights of the respective parties to the flow of the stream herein being litigated, cannot be had without the presence of the said Idaho Irrigation Company, Ltd., and said J. G. White & Co. as parties to the action, and makes this affidavit for the purpose of securing an order of this court and of the judge thereof, directing that said parties, and each of them, may be brought into this suit as parties defendant thereto, and that each of them be served with a copy of the summons in this action and of the order referred to.
This motion was made ex parte and without notice to the defendants in said action, or to the Idaho Irrigation Company, Ltd., or J. G. White & Co. Upon the hearing the court made the following order: “It is, therefore, upon motion of Hawley, Puckett & Hawley and Paul Haddock, attorneys for the plaintiff, ordered and directed that such corporations and each and both of them be brought into this action as parties defendant therein, and that a copy of the summons herein and a copy of the complaint herein and of this order be served upon each of said parties in like manner as provided for the service of the summons. ’ ’
The Idaho Irrigation Company, Ltd., and J. G. White & Co. were served with summons and a eopy of the order, and appeared in said cause and filed demurrers, and afterward withdrew such demurrers and were permitted by the court to file answers and a cross-complaint. Thereafter counsel for defendants filed the following motion: “Comes now the under*378signed, counsel in the above-entitled case, and in behalf of the respective clients move the court to vacate and set aside the order heretofore on the 6th day of August, 1909, made and entered herein, bringing in the Idaho Irrigation Company, Limited, and J. G. White & Company, a corporation, as parties defendant in this cause, and to strike from the files their answer and cross-complaint, upon the following grounds and for the following reasons, to wit:
“First, that said order was made ex parte and upon application of the plaintiffs, and without notice to us or to our clients.
“Second, for the reason that said order could not be properly or legally made by the court at said time, in that all of the evidence in the cause had been taken and the taking of the evidence closed, and the matter was then pending before the court for final judgment and decree.
‘ ‘ Third, it is contended and insisted by said parties defendant, that said order will necessitate the retaking of all the evidence heretofore taken in the cause as proper evidence therein, and would thus work a great hardship and entail large expense upon all the parties thereto.”
Counsel for the Idaho Irrigation Company, Ltd., objected to the court sustaining said motion upon the ground:
“(1) That it proposes to dismiss an action as to the defendant Idaho Irrigation Company, Limited, which defendant has on file in this court in said action a cross-complaint seeking affirmative relief against the plaintiffs and its several eodefendants.
“ (2) The defendant, the Idaho Irrigation Company, Limited, having been made a defendant in order to enable a complete determination of the controversy before the court to be had, to wit, the adjudication of the rights of the respective users of water of Big Wood river and its tributaries, there is no power in the court at this time to revoke such order. ’ ’
The motions to strike and dismiss were heard upon the objections of the Idaho Irrigation Company, Ltd., and after hearing the court made the following order:
“. . . . after due consideration, hereby orders and directs that the answers and cross-complaints of the said Idaho Irriga-. *379tion Company and J. G. “White & Co., be, and the same are hereby stricken from the files, and the said parties are hereby dismissed from said action, for the reason that it appears to the court that the said above-named parties failed and refused to appear in said cause until after the time when the testimony in the above-entitled cause had been fully submitted to the referee, and the referee’s report had been made to the court, and'for the further reason that said order directing that the above-named parties be made parties defendant in said cause was inadvertently made at the date that the said order was entered, and was made only for the purpose of preventing the said parties above named from interfering with the waters of the Big “Wood river, under a temporary order based upon the report of the referee herein, and not for the purpose of making them parties defendant, or requiring them to appear by answer and cross-complaint, for the purpose of putting in any testimony with reference to any rights in- and to the waters of said Big “Wood river or its tributaries, and for the further reason that said order was made ex parte, and without notice to the attorneys for the defendants, and would require the retaking of all the testimony heretofore taken, which would entail enormous and in the opinion of the court unnecessary and unwarranted expense.”
From this latter order and judgment the Idaho Irrigation Company, Ltd., appeals to this court.
It is argued on behalf of appellant that after the court granted the motion of the plaintiffs to make the Idaho Irrigation Company, Ltd., a defendant, and summons was issued and served upon such defendant, and such defendant appeared and filed an answer and cross-complaint seeking affirmative relief, the court had no power or jurisdiction to dismiss the action as to such defendant, but was required under the provisions of sec. 4354 to render judgment on the merits; while on the part of counsel for respondents it is argued that it is not a question of dismissing the action, but rather did the court err in vacating and setting aside an interlocutory order made inadvertently and without notice. It must be conceded that the court had no power or right to dismiss an action over *380the objection of the defendant who has filed an answer or cross-complaint seeking affirmative relief, but is required to-enter judgment on the merits of the issue presented by the cross-complaint. (Rev. Codes, sec. 4354; Mott v. Mott, 82 Cal. 413, 22 Pac. 1140, 1142; Water Company v. Allen, 132 Cal. 432, 64 Pac. 713; Rodgers v. Parker, 136 Cal. 315, 68 Pac. 975; 14 Cyc. 407.)
Does this rule of law, however, apply to the facts of this case? The Idaho Irrigation Company, Ltd., was not made-an original defendant; it was not in existence at the time the-action was commenced. Application was made 'by the plaintiffs to bring in such defendant after months had been consumed in taking the evidence, and after the evidence had been concluded and the decree was in preparation. "When the court’s attention was called to the order by objections made by counsel for defendants, and upon further consideration, the court set aside the order making the Idaho Irrigation Company a defendant, and dismissed its cross-complaint upon the ground: “. . . . that it appears to the court that the said above-named parties failed and refused to appear in said cause until after the time when the testimony in the above-entitled cause had been fully submitted to the referee, and the referee’s report had been made to the court, and for the further - reason that said order directing that the above-named parties be made parties defendant in said cause was inadvertently made at the date that the said order was entered, and was. made only for the purpose of preventing the said parties above named from interfering with the waters of the Big Wood river, under a temporary order based upon the report of the referee herein, and not for the purpose of making them parties defendant, or requiring them to appear by answer and cross-complaint, for the purpose of putting in any testimony ■ with reference to any rights in and to the waters of said Big - Wood river or its tributaries, and for the further reason that said order was made ex pa/rte, and without notice to the attorneys for the defendants, and would require the retaking of " all the testimony heretofore taken, which would entail enor- - *381mous, and, in the opinion of the court, unnecessary and unwarranted, expense.”
There can be no doubt but that the court, at the time this latter order was made, was fully convinced that the order making the irrigation company a defendant was inadvertently made, and inadvertently made for the reasons given in the •order. If the order making the irrigation company defendant was inadvertently made by the trial court, there can be no question but that the trial court had power to set such order aside. No right had as yet been acquired by the Idaho Irrigation Company by reason of the court’s order making it a defendant, except the right to appear and file an answer. The court, no doubt, was of the opinion that by permitting the order to stand allowing the irrigation company to be made a defendant, it would require a retrial of said cause, and put the plaintiffs and defendants to the expense of going over the identical ground which had already been gone over, and that in its judgment it would be better that the order be set aside and the irrigation company relegated to its right to commence a new action, in case it desired to litigate its right to the waters of said stream.
The general rule as to the power of the court to control and direct its orders is stated in 15 Eney. Pl. & Pr., p. 349, as follows: “Every court of superior jurisdiction has, in the absence of statutory limitations, power to control its own orders, and to direct when and under what conditions they shall be operative. Orders are not regarded as res ad judicata with the same strictness as in the case of judgments; accordingly every order made in the progress of a cause may be rescinded or modified upon a proper case for such relief being made out.”
Discussing this matter the supreme court of California, in the case of People v. Curtis, 113 Cal. 68, 45 Pac. 180, says: “The power of the court to cause its records to correctly set forth the orders which it has actually made, as well as to set aside an order which it has made through inadvertence or mistake, is too well established to require argument (Hall v. Polack, 42 Cal. 218; Wiggin v. Superior *382Court, 68 Cal. 398, 9 Pac. 646; Crim v. Kessing, 89 Cal. 478, 23 Am. St. 491, 26 Pac. 1074; Kaufman v. Shain, 111 Cal. 16, 52 Am. St. 139, 43 Pac. 242); and if the question of mistake or inadvertence is disputed, the decision of the judge upon any controverted fact is not open to review. ' In the present case, the statement in the bill of exceptions that the motion to dismiss was based upon the ground that the other cases involved only the same question as those presented in the ease just tried, is not controverted, and it follows, not only that the statement of the court that it did not intend to dismiss any other cases must be accepted as conclusive, but also that the entry by. the clerk dismissing any other eases was made under a mistake on his part in failing to comprehend the scope of the order. "When these facts were brought to the notice of the. court, it became its duty, either' at the instance of the district attorney or upon its own motion without any suggestion from either party, to vacate and set aside the entry that had been made by the clerk.”
In the case of Wiggin v. Supreme Court, 68 Cal. 398, the court quotes with approval the case of Hall v. Polack, 42 Cal. 218, and says: “Where the judgment of a court has been deliberately exercised in a cause, and a final result reached as a conclusion thereof, there are good reasons why it should not be disturbed except by the formal methods prescribed by statute, but rulings, orders, and even judgments inadvertently made are not the result of judgment, but of oversight, neglect, or accident, and are subject to correction by the judge or court making them. ’ ’
Counsel for appellant contends, however, that it was the duty of the court, under the provisions of Rev. Codes, sec. 4113, to make the Idaho Irrigation Company a party defendant, when it appeared that the presence of said company was necessary to a complete determination of the controversy, and that having made said irrigation company'a party defendant, the court should have permitted said defendant to remain in the ease as a party defendant. It is true that in an action to determine the priority of rights of appropria*383tion all parties claiming a right of appropriation should be made either parties plaintiff or defendant to the action; but it does not follow that a failure to make all persons parties who claim the right of appropriation affects the validity of a judgment rendered determining the rights of such parties as have been made parties to the suit. An appropriator of water from a stream is a proper party to a suit affecting the right of appropriation to the waters of such stream, but such person is not an indispensable party, and a judgment rendered in said cause will be just as effective as to the rights and interests of all those who were parties to said action and whose rights have been adjudicated, as though other persons had also been made parties, and in this case the decree rendered by the trial court will be effective and binding upon all parties to the suit, and an adjudication of their respective rights as between such parties, even though the Idaho Irrigation Company was not made a party to said action; and the rights and interests of the Idaho Irrigation Company can in no way be affected, and such judgment would in no way determine the rights of said company, or have any force or effect against such company. (Farmers’ etc. Ditch Co. v. Riverside Irr. Dist., 14 Ida. 450, 94 Pac. 761.)
The trial court no doubt took the view that as the Idaho Irrigation Company was not an indispensable party, it would be in the interests of economy and justice not to permit the order making it a defendant to stand. It may be possible that the irrigation company, after such decree is entered, may not desire to contest the rights fixed by such decree, and if it should, an independent action may be commenced for that purpose, and in that action it may contest the rights of any of the parties fixed by said decree, while others it may admit and make no contest against, and by this method of procedure great expense may be saved by the parties, rather than to permit the order to stand making such defendant a party, and thus place the record in such condition that a retrial would have been necessary; and because of such facts the trial court concluded that the order making said defendant a party was in*384advertently made, and therefore set aside said order and struck the answer and cross-complaint of the Idaho Irrigation Company. In this the court committed no error. Judgment is affirmed. Costs awarded to respondents.
Ailshie, J., concurs. Sullivan, J., sat at the hearing, but did not participate in the opinion.