There have been rare reports of priapism (prolonged and painful erections lasting six or more hours) with the use of PDE5 inhibitors. Patients with blood cell diseases such as sickle cell anemia, leukemia, and multiple myeloma have higher than normal risks of developing priapism. Untreated priapism can cause injury to the penis and lead to permanent impotence. Therefore, if your erection lasts four hours, you should seek emergency care.
Exercise and lifestyle modifications may improve erectile function. Weight loss may help by decreasing inflammation, increasing testosterone, and improving self-esteem. Patients should be educated to increase activity, reduce weight, and stop smoking, as these efforts can improve or restore erectile function in men without comorbidities. Precise glycemic control in diabetic patients and pharmacologic treatment of hypertension may be important in preventing or reducing sexual dysfunction. 
Erections occur in response to tactile, olfactory, and visual stimuli. The ability to achieve and maintain a full erection depends not only on the penile portion of the process but also on the status of the peripheral nerves, the integrity of the vascular supply, and biochemical events within the corpora. The autonomic nervous system is involved in erection, orgasm, and tumescence. The parasympathetic nervous system is primarily involved in sustaining and maintaining an erection, which is derived from S2-S4 nerve roots.
Penile erection is managed by two mechanisms: the reflex erection, which is achieved by directly touching the penile shaft, and the psychogenic erection, which is achieved by erotic or emotional stimuli. The former uses the peripheral nerves and the lower parts of the spinal cord, whereas the latter uses the limbic system of the brain. In both cases, an intact neural system is required for a successful and complete erection. Stimulation of the penile shaft by the nervous system leads to the secretion of nitric oxide (NO), which causes the relaxation of smooth muscles of corpora cavernosa (the main erectile tissue of penis), and subsequently penile erection. Additionally, adequate levels of testosterone (produced by the testes) and an intact pituitary gland are required for the development of a healthy erectile system. As can be understood from the mechanisms of a normal erection, impotence may develop due to hormonal deficiency, disorders of the neural system, lack of adequate penile blood supply or psychological problems. Spinal cord injury causes sexual dysfunction including ED. Restriction of blood flow can arise from impaired endothelial function due to the usual causes associated with coronary artery disease, but can also be caused by prolonged exposure to bright light.
Under normal circumstances, when a man is sexually stimulated, his brain sends a message down the spinal cord and into the nerves of the penis. The nerve endings in the penis release chemical messengers, called neurotransmitters, that signal the corpora cavernosa (the two spongy rods of tissue that span the length of the penis) to relax and fill with blood. As they expand, the corpora cavernosa close off other veins that would normally drain blood from the penis. As the penis becomes engorged with blood, it enlarges and stiffens, causing an erection. Problems with blood vessels, nerves, or tissues of the penis can interfere with an erection.
A vacuum erection device is a plastic tube that slips over the penis, making a seal with the skin of the body. A pump at the other end of the tube makes a low-pressure vacuum around the erectile tissue, which results in an erection. An elastic ring is then slipped onto the base of the penis. This holds the blood in the penis (and keeps it hard) for up to 30 minutes. With proper training, 75 out of 100 men can get a working erection using a vacuum erection device.