My son is now 14 and has been experiencing similar symptoms for about 1 1/2 years. He gets nauseous and throws up, plus experiences headaches with it on occasion. It happens about once every six weeks or so, lasting from a day or two up to a week. Our pediatrician looked at just about everything and couldn't pinpoint a cause. I recently saw a neurologist and she was focusing very much on the headaches (although the nausea seems to be the stronger and more prevailing symptom). She stressed the need for consistent sleep, and enough of it (9 hours nightly), as she said that continuous low-grade sleep deprivation might be involved. So far, that's all we've got. I do hope he will grow out of it - and hope the same for both your sons.
That is how my son started, but at a younger age(he is currently 14, but this started 3 years ago). He now has daily nausea. He also experienced severe migraines for a little over a year and then they quit.
His became daily after a 7 inch growth spurt in a 15 month period. He has since been diagnosed with autonomic dysfunction. We are seeing specialists, but so far the right meds have not been found to get rid of the daily nausea. It doesn't seem to last as long through the day though, so maybe there has been progress.
The doctors tried to pin it on anxiety, but he is a pretty mellow kid. Plus, after seeing a pscyologist, she said "not anxiety."
Look into dysautonomia to see if anything else sounds familiar.
Good Luck!