It sounds to me as though your dentist drilled very close to the nerve in the tooth and didn't cushion the filling. Consequently, the metal filling material reaches close or possibly even touching the nerve in that tooth. Metal cannot be allowed to touch the nerve because it can generate a small voltage. In your case, if one filling is gold and the other is regular filling, that would be dissimilar metals. When they touch in saliva, you have a battery.
If it doesn't get better in a couple days, go back to the dentist and have him do it right.