throw an execption if the insert query doesn't generate keys.