Query Fails When Executed in Thread
Posted: Thu 09 May 2013 20:52
Hello,
I have an application that has been running fine for months that has suddenly started failing. It turns out that when I run a specific query from within a thread it returns zero rows even though there's matching data. It's running in a thread and after several iterations - with no pattern I've been able to discern, it suddenly works. It actually only fails for a specific value of p_QueueConfigId. The same method running in another thread always succeeds with a different value.
The code looks like this:
Using db As New MwtOracleMaxDataContext()
Return db.Swimmessages.Where(Function(x) x.Queueconfigurationid = p_QueueConfigId And x.Status = p_Status).OrderBy(Function(x) x.Createddate).ToList()
End Using
I have an application that has been running fine for months that has suddenly started failing. It turns out that when I run a specific query from within a thread it returns zero rows even though there's matching data. It's running in a thread and after several iterations - with no pattern I've been able to discern, it suddenly works. It actually only fails for a specific value of p_QueueConfigId. The same method running in another thread always succeeds with a different value.
The code looks like this:
Using db As New MwtOracleMaxDataContext()
Return db.Swimmessages.Where(Function(x) x.Queueconfigurationid = p_QueueConfigId And x.Status = p_Status).OrderBy(Function(x) x.Createddate).ToList()
End Using