You are calling this method in an asynchronous manner e.g. the first call of it has not ended before the second one is called. The OpenAccessContext as well as Entity Framework's ObjectContext are not synchronized (thread safe) objects which is shown in your case, when called asynchronously their behavior is really undefined.
What you should do in a callback method handling the background worker finish call, is to create a context with a little scope of usage and not use the one that you use elsewhere in your synchronous operations. So if you consider a code like the following, you should not encounter those problems:
sender, TaskCompletedEvent e)
(EntitiesModel entities =
TASK scheduledTask = entities.Tasks.First(...);
scheduledTask.NextRun = e.NextRun;
TASK_LOG logMsg =
Basically, the main pattern in context management for all ORM's is a context-per-thread approach, so you should use a context for each thread as you can see in this article
, or just create a small-scoped context if applicable as shown in my code-snippet above.
the Telerik team
OpenAccess ORM Q2'12 Now Available! Get your hands on all the new stuff