public static Session GetUserSession(ClearQuestConnectionConfig connConfig) { string idStr = GenerateSessionIdStr(connConfig); lock (s_userSessionLock) { if (s_userSessions.ContainsKey(idStr)) { return(s_userSessions[idStr]); } // create and initialize session object Session userSession = CQWrapper.CreateSession(); TraceManager.TraceInformation("Connecting to CQ User Session"); CQWrapper.UserLogon(userSession, connConfig.User, connConfig.Password, connConfig.UserDB, (int)CQConstants.SessionType.PRIVATE, connConfig.DBSet); TraceManager.TraceInformation("Connected to CQ User Session"); s_userSessions.Add(idStr, userSession); return(userSession); } }