Prostatitis most frequently affects men aged between 30 and 50. Risk factors include a urinary tract infection that is left untreated, having a catheter placed in your bladder for a prolonged period of time and unprotected anal intercourse. However, most men who get prostatitis do not have any risk factors.