They do this at least once throughout their lives. They also have a strange way of taking care of their kids. When the water warms they reproduce by broadcast spawning, ejecting their sperm or eggs into the ocean, all over the place. When the eggs get fertilized to produce new oysters, their parents have nothing to do with them. No pregnancy, no child rearing, nothing.
You can eat oysters, but the food oysters and the ones used for pearls are not the same kind of animal. The food oysters (aka "true oysters" can produce pearls, but they are not even in the same family as the pear oysters. More oyster info at National Geographic.
If you have any idea what this picture has to do with this fact, you win a cookie. We'll email one to you.