So he said we'd try the ldr thing, he dumped me 3wks later

I was in a relationship for two years and a half. Everything was perfect until he got a job offer abroad. He left a month later(very romantic / very loving month). So we decided on trying the long distance relationship thing. Everything was going well. We'd talk during the night and talk like there were no miles between us. 3 and a half weeks later he says it's not working for him and that he rather break things up (all this 2 days before my graduation from med school). He said he wanted to keep in touch, but hasn't been playing the part. 
I'm so heart broken and confused. 
Any advice?