Shevuot (Oaths) 18 - The Proper Way To Withdraw
If one was cohabiting with a woman, and she told him "I have become a niddah" (that is, she sensed during the cohabitation that she has begun to menstruate), and he withdrew immediately (with a "live" organ [erection]) - he is liable to a sacrifice, since his exit is as pleasurable to him as his entry.
Therefore, as Abaye said, he is liable to two offerings. But, as Rava asked, how could it be two offerings? If he is a Sage, and he knows the rules, then he may liable to bring an offering for the entry, but as far as exit - he is doing it deliberately, and offerings are brought only for mistakes! And if he is an ignoramus, this is all one big mistake, and he brings one offering! Rava himself answered his question, explaining that we are dealing with an incomplete Sage, who does not know the prohibition to withdraw immediately, which makes it for him an unintentional mistake.
What should he do? He should "thrust his ten fingernails in the ground, like Joseph" (remain still until his organ becomes limp) and he is fortunate for having conquered his evil inclination.
Art: Jean-Honore Fragonard - Le Verrou (The Bolt)