There are many strains. You will develop immunity to one strain, but not the others.

I assume a vaccine would try to be multivalent.