Ex parte Nautilus Insurance Company, [Ms. 1170170, Mar. 30, 2018] __ So. 3d __ (Ala. 2018). In consolidated actions (Ex parte Nautilus Ins. Co., Alabama Supreme Court Case No. 1170170, and Ex parte Lyon Fry Cadden Insurance Agency, Inc., Alabama Supreme Court Case No. 1170235), the Court unanimously (Stuart, C.J., and Bryan, Bolin, Parker, Shaw, Main, Wise, Sellers, and Mendheim, JJ., concur) considers separate petitions for writs of mandamus seeking orders directing the Baldwin Circuit Court to vacate its orders denying motions to dismiss. The Court grants Nautilus Insurance Company’s petition on the basis of Alabama’s Prior Pending Action statute, § 6-5-440, Ala. Code 1975. The Court denies Lyon Fry Cadden Insurance Agency’s petition, concluding that the denial of a motion to dismiss based upon Rule 12(b)(6), Ala. R. Civ. P., is not reviewable upon a petition for a writ of mandamus, and that the denial of a motion to dismiss premised upon an alleged failure to join indispensable parties under Rule 19, Ala. R. Civ. P., is not reviewable by mandamus either.
As to Nautilus’s petition, the Court concludes that later-filed state court breach of contract, abnormal bad faith, bad-faith-failure-to-settle, breach-of-the-enhanced-duty-of-good-faith, fraud, and negligence claims against this insurer were due to be dismissed under authority of § 6-5-440 because they were compulsory counterclaims required to be filed in federal court in response to the insurer’s earlier-filed complaint for a declaratory judgment which sought a declaration of its rights and obligations under the liability policy at issue. The Court reasoned:
Section 6-5-440 provides:
“No plaintiff is entitled to prosecute two actions in the courts of this state at the same time for the same cause and against the same party. In such a case, the defendant may require the plaintiff to elect which he will prosecute, if commenced simultaneously, and the pendency of the former is a good defense to the latter if commenced at different times.”
Regarding the operation of § 6-5-440, this Court has stated:
“This Code section, by its plain language, forbids a party from prosecuting two actions for the ‘same cause’ and against the ‘same party.’ This Court has previously held that an action pending in a federal court falls within the coverage of this Code section:
“‘“The phrase ‘courts of this state,’ as used in § 6-5-440, includes all federal courts located in Alabama. This Court has consistently refused to allow a person to prosecute an action in a state court while another action on the same cause and against the same parties is pending in a federal court in this State.’”
“Ex parte University of South Alabama Found., 788 So. 2d 161, 164 (Ala. 2000) (quoting Weaver v. Hood, 577 So. 2d 440, 442 (Ala. 1991) (citations in Weaver omitted in University of South Alabama)). Additionally, a compulsory counterclaim is considered an ‘action’ for purposes of § 6-5-440. Penick v. Cado Sys. of Cent. Alabama, Inc., 628 So. 2d 598, 599 (Ala. 1993). As this Court has noted:
“‘This Court has held that the obligation ... to assert compulsory counterclaims, when read in conjunction with § 6-5-440, Ala. Code 1975, which prohibits a party from prosecuting two actions for the same cause and against the same party, is tantamount to making the defendant with a compulsory counterclaim in the first action a “plaintiff” in that action (for purposes of § 6-5-440) as of the time of its commencement. See, e.g., Ex parte Parsons & Whittemore Alabama Pine Constr. Corp., 658 So. 2d 414 (Ala. 1995); Penick v. Cado Systems of Cent. Alabama, Inc., 628 So. 2d 598 (Ala. 1993); Ex parte Canal Ins. Co., 534 So. 2d 582 (Ala. 1988). Thus, the defendant subject to the counterclaim rule who commences another action has violated the prohibition in § 6-5-440 against maintaining two actions for the same cause.’
“Ex parte Breman Lake View Resort, L.P., 729 So. 2d 849, 851 (Ala. 1999). See also University of South Alabama Found., 788 So. 2d at 165 (holding that a party in an action pending in a federal court was subject to the counterclaim rule and thus violated § 6-5-440 by commencing another action in a state court); Ex parte Parsons & Whittemore Alabama Pine Constr. Corp., 658 So. 2d 414 (Ala. 1995) (holding that the prosecution in a subsequent action of claims that had been compulsory counterclaims in a previously filed declaratory-judgment action violated § 6-5-440).”
Ex parte Norfolk S. Ry., 992 So. 2d 1286, 1289-90 (Ala. 2008).
Ms. *7-9. Citing (Ms. *14) Ex parte Brooks Ins. Agency, 125 So. 3d 706 (Ala. 2013), and Ex parte Canal Ins. Co., 534 So. 2d 582 (Ala. 1988), the Court concludes that both parties’ sets of claims arise out of the issuance of the same policy of insurance and hence “arise out of the same transaction or occurrence and are based on the same operative facts.” The test for whether a counterclaim is compulsory is the “logical-relationship test”:
“‘A counterclaim is compulsory if there is any logical relation of any sort between the original claim and the counterclaim.’ Committee Comments on 1973 adoption of Rule 13, [Ala. R. Civ. P.,] ¶ 6. Under the logical-relationship standard, a counterclaim is compulsory if ‘(1) its trial in the original action would avoid a substantial duplication of effort or (2) the original claim and the counterclaim arose out of the same aggregate core of operative facts.’ Ex parte Canal Ins. Co., 534 So. 2d 582, 584 (Ala. 1988) (quoting Brooks v. Peoples Nat’l Bank of Huntsville, 414 So. 2d 917, 919 (Ala. 1982)). In determining whether the claims ‘arose out of the same aggregate core of operative facts,’ this Court must determine whether ‘(1) the facts taken as a whole serve as the basis for both claims or (2) the sum total of facts upon which the original claim rests creates legal rights in a party which would otherwise remain dormant.’ Canal Ins., 534 So. 2d at 584.”
Ex parte Cincinnati Ins. Cos., 806 So. 2d 376, 380 (Ala. 2001).
Ms. *15. Since the claims against Nautilus meet the logical-relationship test, they are compulsory counterclaims in the federal action thereby requiring the dismissal of the later-filed state court claims pursuant to § 6-5-440. Ms. *17-18.
As to Precision’s petition, the Court cites (Ms. *19) Ex parte Kohlberg Kravis Roberts & Co.,L.P., 78 So. 3d 959 (Ala. 2011), for the rule that the denial of a motion to dismiss based upon Rule 12(b)(6) is not reviewable by a petition for writ of mandamus because any alleged error in the denial of such a motion can be adequately remedied by appeal. Further, citing (Ms. *20) Ex parte U.S. Bank Nat’l Ass’n, 148 So. 3d 1060 (Ala. 2014), the Court concludes there is no authority indicating that the denial of a motion to dismiss predicated upon a failure to join an indispensable party is an issue properly reviewable by a petition for a writ of mandamus.
Finally, the Court rejects Lyon Fry Cadden’s argument that it was entitled to dismissal because the claims against it were not ripe for adjudication (as there had not yet been a final determination of liability on the underlying policy of liability insurance) such that the trial court’s subject-matter jurisdiction was allegedly not properly invoked. Citing (Ms. *23-24) Ex parte Safeway Insurance Co. of Alabama, 148 So. 3d 39 (Ala. 2013), the Court concludes that such a contention does not involve a lack of subject-matter jurisdiction, but only a potential merits issue involving the alleged ripeness of the claims.
Because Lyon Fry Cadden did not demonstrate that it had a clear legal right to dismissal from the state action based upon any of its arguments, the petition for writ of mandamus was due to be denied.