Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query cache and LinqService/RemoteDataContext thread safety. #290

Open
limpalex opened this issue Jan 9, 2014 · 1 comment
Open

Query cache and LinqService/RemoteDataContext thread safety. #290

limpalex opened this issue Jan 9, 2014 · 1 comment

Comments

@limpalex
Copy link

limpalex commented Jan 9, 2014

Query objects are not thread-safe. If multiple thread get the same instance they may change each other query parameter values.
Possible solutions (checked):

  • Locking the Query object
  • Marking Query._first field as ThreadStatic, so multiple threads will effectively have independent query cache.

I am not really satisfied with both of these solutions, so I'd like to know your opinion about this problem.

The bug can be noticed only when using LinqService and RemoteDataContext, so I guess there is something wrong with them.

Code example: http://pastebin.com/Vc6eaHry Here I'm trying to find entity by identifier and then checking that identifier is correct.

@limpalex
Copy link
Author

limpalex commented Jan 9, 2014

Identical test for linq2db passed successfully, if that helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant