Rule 3217. Voluntary discontinuance. (a) Without an order. Any party asserting a claim may discontinue it without an order 1. by serving upon all parties to the action a notice of discontinuance at any time before a responsive pleading is served or, if no responsive pleading is required, within twenty days after service of the pleading asserting the claim and filing the notice with proof of service with the clerk of the court; or 2. by filing with the clerk of the court before the case has been submitted to the court or jury a stipulation in writing signed by the attorneys of record for all parties, provided that no party is an infant, incompetent person for whom a committee has been appointed or conservatee and no person not a party has an interest in the subject matter of the action; or 3. by filing with the clerk of the court before the case has been submitted to the court or jury a certificate or notice of discontinuance stating that any parcel of land which is the subject matter of the action is to be excluded pursuant to title three of article eleven of the real property tax law. (b) By order of court. Except as provided in subdivision (a), an action shall not be discontinued by a party asserting a claim except upon order of the court and upon terms and conditions, as the court deems proper. After the cause has been submitted to the court or jury to determine the facts the court may not order an action discontinued except upon the stipulation of all parties appearing in the action. (c) Effect of discontinuance. Unless otherwise stated in the notice, stipulation or order of discontinuance, the discontinuance is without prejudice, except that a discontinuance by means of notice operates as an adjudication on the merits if the party has once before discontinued by any method an action based on or including the same cause of action in a court of any state or the United States. (d) All notices, stipulations, or certificates pursuant to this rule shall be filed with the county clerk by the defendant.