Sanhedrin 55 - Self-Copulation
Rav Achadboi bar Ami inquired of Rav Sheshet, "If who copulates with himself, what is the law?" In other words, if one bends his organ underneath himself until it touches his orifice, is he liable for sodomy? Rav Sheshet answered him, "You upset us with impossible questions!"
In discussing this, Rav Ashi said to Ravina, "What point is in question to you?" You should be able to resolve the inquiry on your own, as follows. In a state of erection, you cannot find such case. Therefore, you can only find such case when the organ is limp. According to the view which says that one is not liable when he copulates with a woman forbidden to him using a limp organ - here too, he is not liable. On the view that one IS liable for such copulation in the case of a forbidden woman, here too, he is obviously liable to two sin offerings: one for committing the copulative act, and one for submitting to copulative act.
Art: John Singer Sargent - Young Man in Reverie