It may related to something else. The ears, nose, and throat can cause an infection in either body part- so it may not just be the ears. I'd get your throat looked at too... Have you had mucus build up in your throat? Recently got over a cold? There are such things as an ear, nose, and throat doctor, which you can see or your general physician :)
Such a condition could be described as a chronic ear infection since it keeps coming back. It occurs when infection or fluid is in the eardrum and does not go away. The best way to prevent the infection is by having follow up examinations to ensure it has healed completely. It mostly happens in children since it is easier for their auditory tube to become clogged compared to an adult. You should see a doctor to get proper treatment and make sure you have follow up examinations to monitor progress.