Click here to Skip to main content
15,900,108 members

Comments by Member 4228925 (Top 9 by date)

Member 4228925 15-Jun-16 16:41pm View    
yes i did. I called the method of the Service 3000 times from SOAP UI, that mean 3000 the DB was also connected and Stopre proc was executed. Still no exception i found while i locally debugged the code.

SqlCommand cmd = SearchAgentsCommand(searchCriteria);
cmd.Connection = con;
con.Open();
dr = cmd.ExecuteReader();
response.Agents = new List<contracts.agent>();
while (dr.Read())
{
Agent = GetAgent(dr, searchCriteria.SearchOnly);
response.Agents.Add(Agent);
}
dr.Close();

if (searchCriteria.SearchOnly == AgentSearchType.U65Agent)
{
foreach (Contracts.Agent agent in response.Agents)
{
agent.Languages = Utilities.GetAgentLanguages(agent.AgentId, con);
}
}

Problem happening at -foreach (Contracts.Agent agent in response.Agents)
So if response.Agents is null then -Null reference exception will come.
But response.Agents can not be null as its being initialized using- response.Agents = new List<contracts.agent>();
So i am clueless...
Adding one more point- There is also another similar job which also try to fetch data from same table. Not sure if there is any race condition or any similar issue or not.
Member 4228925 13-Jun-16 17:11pm View    
Thank you Tejas... But problem is not consistent. At 6:30 am, when job is run, this problem comes and later point of time this problem does not comes. So i am searching for other possible reason- Like issue in the Store proc its calling, the load in the DB , or conflict with other call which is trying to fetch the same table - which is amounting to the null object. My main concern- if it is simple null reference issue, why i dont get it in other time frame?
Member 4228925 13-Jun-16 17:11pm View    
Thank you SA... But problem is not consistent. At 6:30 am, when job is run, this problem comes and later point of time this problem does not comes. So i am searching for other possible reason- Like issue in the Store proc its calling, the load in the DB , or conflict with other call which is trying to fetch the same table - which is amounting to the null object. My main concern- if it is simple null reference issue, why i dont get it in other time frame?
Member 4228925 6-May-15 14:02pm View    
Thank you
Member 4228925 6-May-15 14:01pm View    
Thank you