I've written a WCF webservice that takes XML files and stores them into the database. Everything worked fine under 'low load' but under high load I'm getting some unexpected behavior and thusfar I haven't been able to pinpoint what exactly the problem is. Does anybody have a suggestion?
This is the exception I'm seeing in the logs 'sometimes' - like 25 times out of 10 000:
Exception: System.NullReferenceException: Object reference not set to an instance of an object.
at System.Data.Objects.ObjectStateManager.DetectConflicts(IList`1 entries)
at System.Data.Objects.ObjectStateManager.DetectChanges()
at System.Data.Entity.Internal.InternalContext.GetStateEntry(Object entity)
at System.Data.Entity.DbContext.Entry(Object entity)
... rest of my stacktrace
I see this happen every once-in-a-while and I'm currently looking into whether this has to do with concurrency (some other thread maybe working on the same entity). Can someone maybe give me some pointers as to where to look for?