
178 Cal.App.3d 301 (1986)
223 Cal. Rptr. 678
DARYL GATES et al., Petitioners,
v.
THE SUPERIOR COURT OF LOS ANGELES COUNTY, Respondent; BLASE BONPANE et al., Real Parties in Interest. JAY S. PAUL, Petitioner,
v.
THE SUPERIOR COURT OF LOS ANGELES COUNTY, Respondent; BLASE BONPANE et al., Real Parties in Interest.
Docket Nos. B015825, B015963.
Court of Appeals of California, Second District, Division One.
March 3, 1986.
*303 COUNSEL
James K. Hahn, City Attorney, Lewis N. Unger, Assistant City Attorney, Jack L. Brown and Pamela Victorine, Deputy City Attorneys, Loew & Marr, Robert J. Lowe and Diane Marchant for Petitioners.
No appearance for Respondent.
Margolis, McTernan, Scope & Epstein, William Blum, Dan Stormer, Litt & Stormer, Douglas Mirell and Robert Newman for Real Parties in Interest.
*304 OPINION
ARANDA, J.[*] 

CONSOLIDATION
Two nearly identical petitions for writ of mandate/prohibition have been submitted to this court. One petition (B015963) is on behalf of defendant/petitioner Jay S. Paul, a police officer with the Los Angeles Police Department; the second petition (B015825) is on behalf of all the other defendants/petitioners, hereinafter referred to as "the Gates defendants." Both petitions arose out of the same lower court case (LASC No. C515516). Since the issues are the same they will be considered together.

PROCEDURAL BACKGROUND
We issued alternative writs of mandate in each case to review the trial court's order overruling a demurrer to a taxpayer complaint brought pursuant to Code of Civil Procedure section 526a. We conclude that the complaint fails to state a cause of action and the demurrers should have been sustained.

HISTORICAL BACKGROUND
The instant cases arise out of a taxpayer suit pursuant to Code of Civil Procedure section 526a. Plaintiffs in their first amended complaint allege that this suit arises "from more than a decade of illegal undercover activities conducted by the Los Angeles Police Department, including widespread infiltration and monitoring of and spying and intelligence gathering on individuals and organizations engaged in non-violent political, social and religious activities."
We note that similar litigation arose in a series of previous Code of Civil Procedure section 526a cases entitled Coalition Against Police Abuse, etc., et al. v. Board of Police Commissioners, etc., et al., LASC Nos. C243458, C317528, C374660, C381339, C399552 and C413904 (hereinafter referred to as CAPA). These cases were ultimately consolidated and for all purposes were settled by an out of court settlement and the issuance of a stipulated consent decree. The instant case seeks to recover from the individual police officer defendants an accounting of the allegedly illegally spent funds and the recovery of said funds for the City of Los Angeles and its taxpayers.
*305 The taxpayer plaintiffs also sought declaratory and injunctive relief to have the undercover operations declared illegal and to end permanently the financing of such activities.
Petitioner Paul contends that the Tort Claims Act precludes the taxpayer suit of the real parties in interest. A procedural question is also raised as to whether this court has jurisdiction over a lower court's ruling on a demurrer.

ISSUES
The issues are: (1) Whether this court has the authority to review the overruling of a demurrer in a lower court; (2) whether the instant suit is barred by the Tort Claims Act; (3) whether there was an identity of parties inasmuch as the plaintiffs in the instant case were not plaintiffs in the prior case, Coalition Against Police Abuse et al. v. Board of Police Commissioners et al.; (4) whether the consent decree and settlement in the CAPA case constitutes a final judgment; and (5) whether such consent decree and settlement constitutes a retraxit and bars the instant case on the basis of res judicata.

STATEMENT OF THE CASE
In June 1978, the first of six related actions was instituted in the Los Angeles Superior Court in case No. C243458. That action, Coalition Against Police Abuse et. al. v. Board of Police Commissioners of the City of Los Angeles et al. (CAPA), was subsequently consolidated with cases No. C317528, C374660, C381339, C399522 and C413904. In the consolidated cases, the plaintiffs sought injunctive and declaratory relief as well as compensatory and punitive damages for claimed violations of various constitutional and common law rights by the Los Angeles Police Department's Public Disorder Intelligence Division (PDID).
On December 16, 1982, the first consolidated complaint for injunctive and declaratory relief and damages was filed in CAPA in the Los Angeles Superior Court. The consolidated complaint was brought on behalf of over 100 individual and unincorporated association plaintiffs. The Board of Police Commissioners of the City of Los Angeles was named a defendant as was each of the defendants in the instant action. Plaintiffs brought their action for damages in their individual capacities and also stated taxpayer causes of action pursuant to Code of Civil Procedure section 526a and the common law right of the taxpayer to bring an action to enjoin unlawful government conduct.
On February 24, 1984, before trial had begun in the CAPA cases, the litigation settled. The parties to those actions executed a settlement agreement *306 and stipulated consent decree and judgment. Under the terms of the settlement agreement, the defendant made no admission of wrongdoing, but agreed to a money judgment of $1.8 million ($900,000 to be distributed among the CAPA plaintiffs and $900,000 for plaintiffs' attorneys).
The stipulated consent decree and judgment reserved to the trial court, pursuant to the entry of a declaratory relief judgment, jurisdiction in that action until July 1, 1991, and provided specifically for injunctive relief if necessary, particularly in regard to various procedures relating to the conduct of investigations by the anti-terrorist division (ATD), the successor unit of PDID.
On September 24, 1984, a complaint for accounting and repayment of public funds and declaratory and injunctive relief was filed by the real parties in interest in the instant matter in the Los Angeles Superior Court, case No. C515516. The first amended complaint for accounting and repayment of public funds and declaratory and injunctive relief (taxpayers action) was filed on December 6, 1984. The only alteration between the original and the amended complaint was the change in listed taxpayer plaintiffs.
On February 22, 1985, petitioners filed a demurrer and supporting points and authorities. In the demurrer petitioners attacked the sufficiency of each of the three causes of action on two principal grounds: 1) that the settlement and entry of the consent judgment in CAPA was res judicata and extinguished all of the taxpayer claims brought in the instant action; and 2) that a cause of action for an accounting per Code of Civil Procedure section 526a did not lie as to any of the named individual defendants in that an action for an accounting lies only to compel governmental officers to repay money which was expended in excess of statutorily defined authority. The trial court on July 11, 1985, essentially overruled the demurrers on all grounds.
On July 18, 1985, defendant petitioners filed a motion to reconsider and modify the order overruling the demurrers. In that motion petitioners detailed the presence of the taxpayer claims in the CAPA case and identified the relief granted in the CAPA settlement agreement and stipulated consent decree and judgment. Real parties in interest filed their opposition and on August 7, 1985, the trial court denied petitioners' motion for reconsideration. Whereupon, the Gates defendants filed their petition for writ of mandate/prohibition on August 21, 1985; and subsequently, defendant-petitioner Paul followed by filing his writ of mandate/prohibition on August 27, 1985.


*307 DISCUSSION

I

JURISDICTIONAL ISSUE
(1) This court has the jurisdiction to review the overruling of a demurrer.
We note that writs have been granted to review a trial court's overruling of a demurrer. (7735 Hollywood Blvd. Venture v. Superior Court (1981) 116 Cal. App.3d 901, 903 [172 Cal. Rptr. 528].)

II

THE TORT CLAIMS ACT
(2) Petitioner Paul's contention that the Tort Claims Act precludes the taxpayer suit of the real parties in interest is without merit since there are no personal claims. The Supreme Court has recognized plaintiffs' right to bring this cause of action in Stanson v. Mott (1976) 17 Cal.3d 206, 224, 226 [130 Cal. Rptr. 697, 551 P.2d 1]. Although the Supreme Court went on to hold that the Tort Claims Act's "provisions do reflect a general state policy to limit a public employee's personal financial responsibility for errors committed in the course of his public employment," it did not preclude taxpayer actions. (Id., at p. 225.)

III

IDENTITY OF PARTIES
(3) Even though no plaintiff/respondent in the instant cases was a named plaintiff in CAPA, the necessary privity for res judicata to apply is established by the fact that both suits were commenced as taxpayer actions pursuant to Code of Civil Procedure section 526a and are thus brought by taxpayers suing in a representative capacity. Judgments in representative taxpayer actions are binding on all other taxpayers even though the named taxpayer plaintiff in the second suit was not the same taxpayer who brought the original case.
Where the plaintiff in the prior action commenced the action, as a citizen and taxpayer on behalf of himself and others similarly situated, to determine a matter of general public interest, and where a different plaintiff in the succeeding action commenced that action as a citizen and taxpayer to determine the same matter of public interest, there is identity of parties within *308 the requirement under the doctrine of res judicata. (Price v. Sixth District Agricultural Assn. (1927) 201 Cal. 502, 514-515 [258 P. 387]; Smith v. City of Los Angeles (1961) 190 Cal. App.2d 112, 128 [11 Cal. Rptr. 898].)
We hold that the necessary privity has been established so that there was an identity of parties in the instant case with those in CAPA. The plaintiffs in the CAPA decision were resident taxpayers of the City of Los Angeles and the State of California pursuant to Code of Civil Procedure section 526a and brought their action pursuant to their statutory authority and the common law right of taxpayers to bring an action to enjoin unlawful government conduct.[1]
(4) With regard to the issue of privity, the doctrine of res judicata operates to bar any further litigation arising out of the same subject matter of a prior action as between the same parties or parties in privity with them. (People v. Sims (1982) 32 Cal.3d 468, 477, fn. 6 [186 Cal. Rptr. 77, 651 P.2d 321].)
When an issue has been litigated, all inquiry respecting the same matter is foreclosed, not only as to matters heard but also to matters that could have been heard in support of or in opposition thereto. This rule has been aptly stated as follows: "`"It is important to note in this connection, however, that even though the causes of action be different, if the second action involves a right, title or issue as to which the judgment in the first action is a conclusive adjudication, the estoppel so far as that right, title or issue is concerned must likewise extend to every matter which was or might have been urged to sustain or defeat the determination actually made."'" (Smith v. City of Los Angeles, supra, at pp. 127-128.)

IV

DOES A SETTLEMENT AGREEMENT AND STIPULATED CONSENT DECREE CONSTITUTE A FINAL JUDGMENT?
(5a) Petitioners contend that the instant case is barred by res judicata in that the previously litigated case of CAPA was settled pursuant to a written *309 settlement and a stipulated consent decree which per se constitutes a judgment on the merits. Respondents counter that the instant case is not barred by the CAPA settlement and judgment in that said settlement contained no terms to constitute a judgment on the merits, but that even if a judgment on the merits was rendered in said CAPA case settlement that said consent decree and stipulated judgment does not extend to the causes of action stated in the instant case and cannot bar the instant case from going forward; and further, that the instant case is not barred by CAPA because the taxpayer claims set forth in the instant complaint could not have been raised in the CAPA decision.
It is clear, that both in the instant case and in the previous CAPA case the cause of action under Code of Civil Procedure section 526a was in our opinion similar. (6) "The essence of a cause of action is the existence of a primary right and one violation of that right, i.e., it arises out of an antecedent primary right and corresponding duty, and a breach of such primary right and duty by the person upon whom the duty rests." (Colvig v. RKO General, Inc. (1965) 232 Cal. App.2d 56, 65-66 [42 Cal. Rptr. 473].) The cause of action is simply the obligation sought to be enforced. (O'Hagen v. Board of Zoning Adjustment (1971) 19 Cal. App.3d 151, 163 [96 Cal. Rptr. 484]; Colvig v. RKO General, Inc., supra, at p. 66.)
A cause of action must be distinguished from the remedy, which is simply the means by which the obligation or corresponding duty is effectuated, and also from the relief sought. (O'Hagen v. Board of Zoning Adjustment, supra, at p. 163; Merlino v. West Coast Macaroni Mfg. Co. (1949) 90 Cal. App.2d 106, 115 [202 P.2d 748].)
(5b) The action for an accounting which is the primary cause of action in the instant matter, is but another form of relief brought on a taxpayer theory. The settlement agreement and the stipulated consent decree and judgment in CAPA conclusively settled the taxpayers' causes of action. It is res judicata, as a final judgment on the merits is binding on the parties, and bars the litigation of any cause of action arising out of the subject matter of that case. (People v. Sims, supra, 32 Cal.3d 468.)
Although the accounting action now advanced may raise a different issue, it is clearly an action which might have been raised in CAPA. The defendants in this action from whom real parties seek an accounting were all defendants in CAPA. Having settled that case, taxpayer plaintiffs cannot now seek an accounting from the same defendants for the same allegedly improper behavior.
Real parties' contention that the instant case differs from CAPA inasmuch that CAPA was an action against public entities and officials whereas the *310 instant action is on behalf of public entities is without merit. But, we note that the actions are similar because the plaintiffs are in privity inasmuch as they are also taxpayers pursuant to Code of Civil Procedure section 526a, the defendants are the same (the police officers who did the alleged wrongdoings), and the purpose of the litigation is the same, i.e., to punish the alleged wrongdoers so as to prevent a recurrence of similar conduct.
Further, the real parties' contention that there are two separate classes of taxpayers actions, i.e., those under Code of Civil Procedure section 526a to restrain or prevent the illegal expenditure of public funds and those "to commence an action on behalf of the public treasury to recover funds previously expended illegally" is worthy of note. We note that despite real parties' characterization of the CAPA suit as being in the former category and the instant case in the latter category, the pleadings in both instances rely upon Code of Civil Procedure section 526a.
In the instant Gates/Paul defendant case, the complaint in paragraph 2 on page 2 specifies: "This court has jurisdiction to order defendants to repay the City of Los Angeles all wrongful expenditures of public funds pursuant to Code of Civil Procedure section 526(a) [sic]."
In CAPA, the plaintiffs' complaint at page 5, paragraph 5 reads: "This court has jurisdiction to order defendants to perform their duties discussed below on behalf of the plaintiff resident taxpayers of the City of Los Angeles and the State of California pursuant to Code of Civil Procedure § 526a...."
Thus, although in CAPA the plaintiffs pled for the recovery of funds on behalf of the taxpayers, none were recovered and the settlement agreement contained no provisions of wrongdoing. Hence, the settlement of the CAPA case constituted an abandonment of the CAPA plaintiffs' claims, both for damages as individuals and for equitable relief as taxpayers. In settling that litigation and consenting to the entry of judgment, the CAPA taxpayer plaintiffs settled their claims and thereby extinguished all equitable claims which were or might have been brought under Code of Civil Procedure section 526a.
We conclude that respondent's allegations that the taxpayer complaint set forth in the instant complaint could not have been raised in the previous decision is without merit, since the CAPA case was brought as we have noted pursuant to Code of Civil Procedure section 526a. The fact that the final consent decree and settlement documents did not set forth specific settlements of the taxpayer demands in the instant case is not unusual. Most compromise settlements are settled on the basis of one or two possible causes *311 of action rather than on all causes of action. The compromise settlement of the lawsuit and entry of the consent judgment must be given a res judicata effect in a subsequent action, barring not only the reopening of the original controversy, but also subsequent litigation of all issues which were or could have been raised in the original suit. (Kronkright v. Gardner (1973) 31 Cal. App.3d 214, 218 [107 Cal. Rptr. 270]; Folsom v. Butte County Assn. of Governments (1982) 32 Cal.3d 668, 677 [186 Cal. Rptr. 589, 652 P.2d 437]; 7 Witkin, Cal. Procedure (3d ed. 1985) Judgment, § 225, pp. 662-663; Nash Cty. Bd. of Ed. v. Biltmore Co. (4th Cir.1981) 640 F.2d 484.)
Hence, the cause of action for accounting arising out of Code of Civil Procedure section 526a is barred since it merely seeks another remedy from the same cause of action and it is further litigation on the same subject matter.

V

DOES THE SETTLEMENT AGREEMENT AND STIPULATED JUDGMENT CONSTITUTE RETRAXIT?
The final issue presented is whether there is retraxit. Petitioners contend that the consent decree and settlement constitutes a final judgment whereas, respondent contends that the stipulated consent decree and judgment in the CAPA decision make it clear that there was no judgment on the merits rendered in that case.
(7) We hold that the effect of a dismissal with or without prejudice, when it is filed in return for consideration from the defendant, acts as a complete bar to any future actions on the same controversy and has the same legal effect as a common law retraxit. "`Where the parties to an action settle their dispute and agree to a dismissal, it is a retraxit and amounts to a decision on the merits and as such is a bar to further litigation on the same subject matter between the parties.'" (Datta v. Staab (1959) 173 Cal. App.2d 613, 621 [343 P.2d 977].)
The second issue raised in the demurrers was that a cause of action for an accounting pursuant to Code of Civil Procedure section 526a does not lie because an accounting lies only to compel governmental officers to repay money expended in excess of their statutory authority. In view of our decision on the basis of res judicata, we need not address this issue.
Let a peremptory writ of mandate issue directing the trial court to vacate its order overruling the demurrers and to enter a new and different order *312 sustaining the demurrers without leave to amend. The alternative writ is discharged.
Hanson (Thaxton), Acting P.J., and Lucas, J., concurred.
The petition of real parties in interest for review by the Supreme Court was denied July 10, 1986.
NOTES
[*]   Assigned by the Chairperson of the Judicial Council.
[1]  Paragraph 5 of the complaint in CAPA states:

"This court has jurisdiction to order defendants to perform their duties discussed below on behalf of the plaintiff resident taxpayers of the City of Los Angeles and the State of California pursuant to Code of Civil Procedure § 526a and the common law right of a taxpayer to bring an action to enjoin unlawful government conduct, in that the failure of defendants to perform their duties in accordance with the California and United States Constitutions constitutes an illegal expenditure of monies by the City of Los Angeles and the State of California. The plaintiff taxpayers do not seek relief pursuant to 42 U.S.C. § 1983."
