
41 Cal.Rptr.3d 833 (2006)
138 Cal.App.4th 769
MID-CENTURY INSURANCE COMPANY, Petitioner,
v.
SUPERIOR COURT for the County of Los Angeles, Respondent;
Timougeen Bandek, Real Party in Interest.
No. B186140.
Court of Appeal, Second District, Division Three.
April 14, 2006.
*834 Jeffrey J. Leist, Mark Schaeffer, and Shea Stokes Carter (Los Angeles); Lawrence W. Shea II, Mark Petersen, and Shea Stokes Carter (San Diego); Eric N. Riezman and Shea Stokes Carter (Costa Mesa) for Petitioner.
No appearance for Respondent.
Jeffrey D. Diamond for Real Party in Interest.
ALDRICH, J.

INTRODUCTION
This writ proceeding concerns the applicability of Code of Civil Procedure section 340.9, which revives certain claims that owners of property damaged in the Northridge earthquake have against insurance companies. By its terms, section 340.9 does not revive a time-barred claim that has been "litigated to finality in any court of competent jurisdiction prior to the effective date of this section." (§ 340.9, subd. (d)(1).) The question before us is whether section 340.9 revives a lawsuit that was terminated in 1997 after a demurrer was sustained without leave to amend solely on statute of limitations grounds, and then dismissed without prejudice.
Petitioner and defendant, Mid-Century Insurance Company (Mid-Century) seeks an order directing the trial court to vacate its order that denied Mid-Century's motion for judgment on the pleadings. We hold, under settled principles, when a demurrer to a complaint is sustained without leave to amend solely by virtue of the statute of limitations, and the time for direct attack on the judgment has passed, that the case is final; but it is not "litigated to finality" under Code of Civil Procedure section 340.9, subdivision (d)(1). Therefore, plaintiff Timougeen Bandek (Bandek)'s lawsuit against Mid-Century may proceed. According, we deny the writ petition.

FACTUAL AND PROCEDURAL BACKGROUND
Bandek owned a residence in Glendale, California that was insured by Mid-Century for loss caused by earthquake. Bandek's property sustained damage in the Northridge earthquake on January 17, 1994. He contacted his insurance agent about the damage but was advised not to make a claim because the repair costs might be less than the deductible. Bandek's property sustained additional damage in an aftershock in June 1995 and he again contacted his agent. Mid-Century investigated but denied Bandek's clam.
On September 23, 1997, Bandek filed a lawsuit against Mid-Century seeking damages for breach of contract, negligence, breach of the implied covenant of good faith and fair dealing, and fraud. Mid-Century demurred to the complaint. The trial court sustained the demurrer without leave to amend because the limitations period had run. Before the trial court entered judgment dismissing the action (Code Civ. Proc., § 581d), Bandek dismissed his lawsuit without prejudice. (§ 581, subd. (c).)
On December 28, 2001, after enactment of Code of Civil Procedure section 340.9 (Stats.2000, ch. 1090, § 1)), Bandek filed a second lawsuit positing essentially the same allegations as in the first complaint, and seeking damages for breach of contract and breach of the covenant of good faith and fair dealing. The case was assigned *835 to the court handling the Northridge earthquake lawsuits against companies related to Mid-Century, among others.
Thereafter, Mid-Century moved for judgment on the pleadings. It argued that Code of Civil Procedure section 340.9 did not revive Bandek's claim because his 1997 lawsuit had been "litigated to finality" under subdivision (d)(1) of that section. Mid-Century also argued that the 2001 lawsuit was barred by the doctrines of res judicata and collateral estoppel.
Bandek responded that the earlier action had been dismissed without prejudice based solely on the one-year time period in the Mid-Century policy and so Code of Civil Procedure section 340.9 revived it. Bandek further observed that none of the issues in this 1997 lawsuit were decided on the merits with the result that neither res judicata nor collateral estoppel barred his action. The trial court denied Mid-Century's motion for judgment on the pleadings explaining that "[a]pplication of the `litigated to finality' exception [in] Code of Civil Procedure § 340.9(d)(1) on the facts of this case would be inconsistent with the purpose and intent of the statute." The court also found that the doctrines of res judicata and collateral estoppel did not apply. Mid-Century commenced this writ proceeding.

DISCUSSION
Enacted in 2000, Code of Civil Procedure section 340.9[1] allows otherwise time barred Northridge earthquake claims against insurance companies to go forward by extending the statute of limitations for certain lawsuits arising from the Northridge earthquake until December 31, 2001. But, by its own terms, section 340.9 does "not apply" to "[a]ny claim that has been litigated to finality in any court of competent jurisdiction prior to the effective date of this section." (Code Civ. Proc., § 340.9, subd. (d)(1), italics added.)
The meaning of "litigated to finality" in Code of Civil Procedure section 340.9 has been decided. In 20th Century Ins. Co. v. Superior Court (2001) 90 Cal.App.4th 1247, 109 Cal.Rptr.2d 611 (cert. den. 535 U.S. 1033, 122 S.Ct. 1788, 152 L.Ed.2d 648), we stated that "[T]he Legislature has emphasized its intention that `finality' in the res judicata sense is required before section 340.9, subdivision (d)(1)'s exception will apply." (Id. at p. 1278, 109 Cal.Rptr.2d 611.) We explained that in California, "`[a]n action is deemed to be pending from the time of its commencement until its final determination upon appeal, or until the time for appeal has passed. . . .' [Citation.] Thus, a judgment in California is not final for all purposes until `all possibility of direct attack thereon by way of (1) appeal, (2) motion for a new trial, or (3) motion to vacate the judgment has been exhausted.' [Citations.] In McKee, the court interpreted Insurance Code section 11580, subdivision *836 (b)(2) [requiring all insurance policies to permit an action on the policy after final judgment against the insured has been entered], as meaning that `the statute and the standard policy language permit an action against an insurer only when the underlying judgment is final, and "final" for this purpose, means an appeal from the underlying judgment has been concluded or the time within which to appeal has passed.' [Citation.] Thus, in this sense, the courts speak of `finality' for res judicata purposes." (Ibid., italics added, citing McKee v. National Union Fire Ins. Co. (1993) 15 Cal.App.4th 282, 285-288, 19 Cal. Rptr.2d 286.)
We further explained, with reference to Code of Civil Procedure section 340.9, that "[b]y not using the ambiguous term, `final judgment,' but rather limiting the exception to cases which have been `litigated to finality,' the Legislature has in our view, made it clear that it intends section 340.9 to apply to all cases which have not been finally decided on appeal.... Indeed, by not using the word `judgment' in section 340.9, subdivision (d)(1), the Legislature avoided any suggestion that a `final' (for notice of appeal purposes) trial court judgment might make section 340.9 inapplicable." (20th Century Ins. Co. v. Superior Court, supra, 90 Cal.App.4th at p. 1278, 109 Cal.Rptr.2d 611; accord Hellinger v. Farmers Group, Inc. (2001) 91 Cal.App.4th 1049, 1059-1060, 111 Cal.Rptr.2d 268 [case not "litigated to finality" under section 340.9 if timely notice of appeal had been filed by the time that section became effective]; Bialo v. Western Mutual Ins. Co. (2002) 95 Cal.App.4th 68, 74, 82-83, 115 Cal.Rptr.2d 3 [case not "litigated to finality" under section 340.9 while timely appeal is pending].) Thus, "final" in "litigated to finality" means final as applied under the doctrine of res judicata.
In Bandek's 1997 lawsuit, the trial court sustained Mid-Century's demurrer to the complaint without leave to amend and the action was dismissed on April 15, 1998. No appeal was taken. Therefore, Bandek's 1997 lawsuit was "final" in the sense that the time for direct attack by appeal, motion for a new trial, or motion to vacate the judgment has lapsed. (20th Century Ins. Co. v. Superior Court, supra, 90 Cal.App.4th at p. 1278, 109 Cal.Rptr.2d 611; Cal. Rules of Court, rules 2, 3(a) & 3(b).)
Bandek contended that the complaint in his 1997 action was dismissed without prejudice and so he could always refile it. Generally, plaintiffs can voluntarily dismiss their actions until "actual commencement of trial," which enables them to refile the action later (Code Civ. Proc., § 581, subd. (c); cf. Gray v. Superior Court (1997) 52 Cal.App.4th 165, 173, 60 Cal.Rptr.2d 428.) Yet, "`the right of a plaintiff to voluntarily dismiss an action before commencement of trial is not absolute.' [Citation.] There are statutory exceptions to a plaintiff's right of voluntary dismissal, and `other limitations have evolved through the courts' construction of the term `commencement of trial.'" [Citation.] The meaning of the term `trial' is not restricted to jury or court trials on the merits, but includes other procedures that `"effectively dispose of the case."' [Citation.] [¶] A plaintiff is precluded from voluntarily dismissing an action without prejudice under various circumstances short of a full trial. Those circumstances include a general demurrer sustained without leave to amend, a general demurrer sustained with leave to amend where no amendment is made within the allotted time, and where all issues have been deemed admitted in defendant's favor. [Citations.]" (Mary Morgan, Inc. v. Melzark (1996) 49 Cal.App.4th 765, 769, 57 Cal.Rptr.2d 4, italics added, quoting Wells *837 v. Marina City Properties, Inc. (1981) 29 Cal.3d 781, 785, 176 Cal.Rptr. 104, 632 P.2d 217.) For our purposes, a tentative ruling sustaining a demurrer without leave to amend bars a voluntary dismissal. (Groth Bros. Oldsmobile, Inc. v. Gallagher (2002) 97 Cal.App.4th 60, 70, 118 Cal. Rptr.2d 405.) Bandek had no right to dismiss his case without prejudice to preserve his right to refile because the trial court had already issued its tentative ruling sustaining Mid-Century's demurrer without amendment.
Yet, notwithstanding Bandek's 1997 action was "final" in that it was terminated by the sustaining of a demurrer, and the period for direct attack had expired, that case was not final "in the res judicata sense," as we defined "litigated to finality" under subdivision (d)(1) of section 340.9 of the Code of Civil Procedure. (20th Century Ins. Co. v. Superior Court, supra, 90 Cal.App.4th at p. 1278, 109 Cal.Rptr.2d 611.)
"It is settled that the doctrine of res judicata precludes parties or their privities from relitigating a cause of action that had been finally determined by a court of competent jurisdiction. [Citations.] However, a judgment not rendered on the merits does not operate as a bar. [Citations.] [¶] Termination of an action by a statute of limitations is deemed a technical or procedural, rather than a substantive, termination. [Citation.] `Thus the purpose served by dismissal on limitations grounds is in no way dependent on nor reflective of the merits  or lack thereof  in the underlying action.' [Citation.] In fact, statutes of limitation are intended to set controversies at rest by foreclosing consideration on the merits of the claim. [Citations.]" (Koch v. Rodlin Enterprises (1990) 223 Cal.App.3d 1591, 1595-1596, 273 Cal.Rptr. 438, italics added [termination of action on statute of limitations grounds is not substantive and not on the merits and does not have res judicata effect], quoting Lackner v. LaCroix (1979) 25 Cal.3d 747, 751-752, 159 Cal.Rptr. 693, 602 P.2d 393 [termination of prior action on statute of limitations ground is not on the merits]; see Finnie v. District No. 1  Pacific Coast Dist. Etc. Assn. (1992) 9 Cal.App.4th 1311, 1319-1320, 12 Cal.Rptr.2d 348 [dismissal after demurrer sustained for lack of subject matter jurisdiction is not on the merits and does not have res judicata effect].)
While Bandek's 1997 lawsuit was terminated and the time for direct attack on the judgment has long since passed, the judgment is not final "in the res judicata sense" because it was not litigated on the merits where it was disposed of solely on technical grounds. That is, because the case is not final for purposes of res judicata, that doctrine does not bar his 2001 lawsuit. It follows that the subdivision (d)(1) exception to Code of Civil Procedure section 340.9 does not preclude Bandek's 2001 lawsuit where res judicata does not bar it. This is a logical result considering that the question of the statute of limitations has been abrogated by section 340.9.
Our conclusion comports with the intent of the Legislature in enacting Code of Civil Procedure section 340.9, namely, "`to bring needed relief to the victims of the Northridge earthquake." (Sen. Com. On Judiciary, 3d reading analysis of Sen. Bill No. 1899 (1999-2000 Reg. Sess.) as amended July 6, 2000, p. 2.) The Legislature was moved to act exactly because "the one-year statute of limitations contained in Insurance Code section 2071 has unfairly barred victims from being compensated for their losses because many were tragically misled about the extent of damage suffered as a result of the earthquake." (Ibid.) To deny Bandek his claim solely on the technical grounds that his 1997 lawsuit was barred by the statute of limitations would contravene *838 the express purpose section 340.9 to revive exactly those claims that had been precluded by the statute of limitations. Such a result would be especially unfair where the Bandek's 1997 lawsuit was never "litigated to finality." We disagree with Mid-Century that our reading of the statute effectively adds a caveat to the "litigated to finality" exception of section 340.9, subdivision (d)(1) that would preclude revival of Northridge earthquake cases previously litigated to finality, except those previously litigated on limitations grounds. Bandek's case was never "litigated to finality," but disposed of on the mere technicality that it was untimely by virtue of the very same statute of limitations that the Legislature has seen fit to override with section 340.9. Our ruling, permitting Bandek to revive his lawsuit against Mid-Century under Code of Civil Procedure section 340.9 will allow the case to be decided on its merits without undermining the subdivision (d)(1) exception.

DISPOSITION
The petition for writ of mandate is denied. Petitioner is to bear the costs of this writ proceeding.
We concur: CROSKEY, Acting P.J., and KITCHING, J.
NOTES
[1]  Code of Civil Procedure section 340.9 states in relevant part: "(a) Notwithstanding any other provision of law or contract, any insurance claim for damages arising out of the Northridge earthquake of 1994 which is barred as of the effective date of this section solely because the applicable statute of limitations has or had expired is hereby revived and a cause of action thereon may be commenced provided that the action is commenced within one year of the effective date of this section. This subdivision shall only apply to cases in which an insured contacted an insurer or an insurer's representative prior to January 1, 2000, regarding potential Northridge earthquake damage. [¶] ... [¶]

"(d) This section shall not apply to either of the following: "(1) Any claim that has been litigated to finality in any court of competent jurisdiction prior to the effective date of this section." (Italics added.)
