Swapna Dosh (Nocturnal emission) is a major problem in maintaining celibacy. What are the ways to eliminate it entirely?
God realization or extremely strong will power is required for maintaining chastity. Swapna Dosha isn't harmful for a householder though.
Gospel of Sri Ramakrishna / Volume 1 / Rules For Householders And Monks:
Loss of semen impairs the strength. But it does not injure one if one loses it in a dream. That semen one gets from food. What remains after nocturnal discharge is enough. But one must not know a woman.
But such discharge is harmful for a Sannyasi.
To lose semen is extremely harmful for a sannyasi. Therefore he must live so carefully that he will not have to see the form of a woman. He must keep himself away from a woman even if she is a devotee of God. It is injurious for him to look even at the picture of a woman. He will lose semen in a dream, if not in the waking state.
For spiritual progress, self control is required be it Sannyasi or householder.
To be able to realize God, one must practise absolute continence.
Those who can practice continency for 12 years develop a power through which their memory becomes super sharp.
There is another class, who previously have had discharges of semen but who later on have controlled them. A man controlling the seminal fluid for twelve years develops a special power. He grows a new inner nerve called the nerve of memory. Through that nerve he remembers all, he understands all.
Strong will power is required to resist the urge.
If lust and anger injure a man, he must renounce them once for all. If a tortoise once tucks in its limbs, it won't put them out again though you may cut it into four pieces.
Continence must be practiced until one gets realization because after God realization, one is permanently free from all sorts of desire.
Lust, anger, and the other passions cannot exist after the vision of God.