Rather than a Sonar problem, this sounds like your Midi signal is getting interrupted. Check the following:
1) Your midi driver (if any is required) is up to date.
2) Your USB cable is good. Swap with another one to be sure.
3) Your USB connection is good. Check that both ends are securely plugged in and don't jiggle (overmuch).
Once the Midi signal is lost, Sonar won't go to any trouble to try and find it if it shows up again. That's just the way it is.
Regards,
Dan