I had an affair with my now wife, while still married to my ex husband. Yes, I committed adultery, HOWEVER, that is in the past. I have confessed it and was forgiven by God. It does me no good, nor does it glorify God, to sit around and embrace past mistakes, failures, sins, etc... God is a god of forgiveness and grace. He doesn't sit there and proverbially pound you over the head over what happened in the past. God understands us as humans and he understands our frailty and our wayward hearts. That would be the whole purpose behind the sacrifice of Jesus on the cross.
I didn't intend for anything to happen with her, it just did and many times afterwards I would cry and swear I would never do it again. I finally decided to quit lying to myself about my attraction to her, and filed for divorce. I would have filed for divorce anyway, because he was a complete jerk. Our relationship had long been dead, when I began the affair with her. It doesn't justify anything, though. Adultery is wrong, but I maintain that if the church didn't criminalize gay relationships, there would be no reason to hide them.
Point is-please stop beating yourself up over this and tell your sons to respect who you are regardless if they agree with it or not. Are you still married to your wife? Are you in a gay relationship?
My two daughters were older (13 and 16) when I told them I was a lesbian. My oldest daughter has turned away from church and refuses to go to a church that doesn't welcome gay people. The younger one believes homosexuality is wrong, but supports me and loves me nonetheless. Both have marched in Pride parades and love my gay friends. It has been a journey but my kids love me and know that I wouldn't ever do anything to hurt or harm them. My being a lesbian does neither and they know that. It takes awhile. Give your sons time but don't let them beat you up over this.
Keltic has 3 sons and I think they have all come around and support him. He would be a good person to bounce things off of, he's been there with the wife and kids thing and understands the complexity of it all.
I hope things iron out for you and that your kids come around and you get some peace about this whole thing.