Dreaming about ex from years ago

I was dumped in high school and at the time it felt horrible. This was years ago. I’ve moved on and am married now, but every once in a while I’ll have a dream about him and I’m trying to win him back in the dream and he keeps rejecting me over and over. I feel awful when I wake up and beat myself up about the dream. I feel pathetic for still dreaming about something that happened so long ago. I don’t want to dream about this anymore. After the dream I start to think about him wondering what he’s doing now, or remember that time in my life, and then I feel pathetic again. How do I stop this dream?