I can tell you what happened to me.
I went to a neighborhood party in the first few weeks of being sober. I made it through the party. I dug my heels in and said I would not drink and I didn't. The next day, I was obsessed with drinking, went out and bought a bottle of wine, end of story. I realized that even when I got through a situation where people were drinking and I didn't, it still had a profound effect on me.
I decided at that point, to not be around anyone who was drinking alcohol for a very long time. And, that's what worked for me.