I was also going to suggest using a crate in the class. If they are barking for each other, maybe your dog is having a bit of separation anxiety for your other dog? You could try walking them separately and seeing how they behave? Not all the time, but maybe it would help them get used to being away from each other a little bit? Just a suggestion, other than what bextull has put, I'm not really sure.
One of my sisters dogs had moderate-severe anxiety, especially separation anxiety issues. She had rescued him from a shelter, and over time as he became more comfortable in her home he slowly grew more trustful and relaxed.
I take it this is not a new pet though? Sudden changes in behavior like that might signal something else going on medically perhaps. Did any incident happen that might have caused him to become suddenly more fearful and anxious? I'm not sure, but maybe talk to your vet to rule out any medical issues. There are also anti-anxiety meds for dogs too you may want to inquire about if it isn't medically related.