Rarely, surgery is needed to help ulcers heal. You may need surgery if your ulcers:  Do not heal. Keep coming back. Bleed. Break through the stomach or duodenal wall. Block food from moving out of the stomach.