I have this condition where I see that the thread's CallContext is carrying foreward the data in consequent calls.
Consider I have a simple API which when queired, will set one data entry into CallContext using :
// entry to the API execution within OnStartProcessingRequest method of DataService
if(CallContext.LogicalGetData("data") != null)
CallContext.LogicalSetData("data", someValue)
print("data " + CallContext.LogicalGetData("data"))
When I see the logs after some API queries, I see similar logs.
| thread | log |
| 237 | data 23 |
| 145 | data 19 |
| 872 | data 78 |
| 237 | data 23 |
My concern is why did thread with ID 237 pick up old data? i.e. 23
I'm sure the control didn't go inside the LogicalSetData block of code as it already had data.
I'm not sure why this is happening? Can anyone help me with this?
The service is a WCF dataservice. Call is being made from postman REST client.