Sleeping on your side is actually supposed to be the best; lying on your back is supposed to be risky in cutting off oxygen supply. Is there something in your diet you might be able to change to avoid the heartburn? Or perhaps you can try to remain on your left side and see if the baby shifts positions and you'll be more comfortable. Good luck. Hope you get some nice sleep soon.
I tried changing my diet i stopped eating anything that contained fat or acid but it didnt work, i even tried not eating after a certain time but that didnt work, the doc gave me everything to help with the heartburn but it didnt work either, so i think i will just have to live with it untill the baby is born.