PHOENIX-1172 Prevent lock contention in ConnectionQueryServicesImpl. Fix exception handling. (Samarth Jain)