bacterial vaginitis

Why do I keep getting this every time I have raw sex with my boyfriend? What can I do to prevent it?? Even after we've both showered and we have sex, in the next few days I get it . It's embarrassing and frustrating. Is there everyday medication that can be used?