I'm developping a multi threaded windows application, and i use the forward mapping to generate the database and manage my objects (rlinq).
My question is what is the good practice when using a rlinq in a multi threaded application. Should I
- have only one db context for the application, and in this case, how do I ensure that a SaveChanges() in one thread has no impact on another (to ensure data integrity)?
- instanciate one db context each time i need, and in this case, how do i manage the fact that an object may be selected with a db context, and updated with another?
Am i right when i say that in the backend configuration, the option "multithreaded context" allows the same db context to be accessed by several threads, but does not ensure that a SaveChanges() called in one thread will have no impact on changes done in another thread on the same db context?
The previous app i've developped used OpenAccess ORM Classic, to manually manage transaction and database concurrence. Do I have to get back use that again?
Is there an example somewhere where i can find information?
I'm a little bit lost, any help would be much appreciated!!