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

EF+ | Query Future | InMemory Provider #102

Open
zzzprojects opened this issue Dec 22, 2016 · 4 comments
Open

EF+ | Query Future | InMemory Provider #102

zzzprojects opened this issue Dec 22, 2016 · 4 comments
Assignees

Comments

@zzzprojects
Copy link
Collaborator

Issue from #86

Currently investigating this issue due to unit testing. My thought is that you are perhaps over-complicating it.

Batching of future transactions helps on round trips to database servers. Particularly important when that db server is not on the same machine.
In Memory is always local. (as far as i know) And its fast... It is also not relational.
So for InMemory, bypass batching. Short Circuit the issue. At a high level check for in memory and bypass all the batching logic. Just let the call happen normally for EFCore.

@zzzprojects zzzprojects self-assigned this Dec 22, 2016
@zzzprojects zzzprojects removed their assignment Jan 2, 2017
@JonathanMagnan JonathanMagnan self-assigned this Jan 3, 2017
@ksmithRenweb
Copy link
Contributor

Hi,

When can we expect this to be fixed?

Thanks,
Kevin

@JonathanMagnan
Copy link
Member

Hello @ksmithRenweb ,

Thank you for the reminder.

The v1.4.24 is now available which now support InMemory provider for Query Future.

Let me know if it's working.

Best Regards,

Jonathan

@ksmithRenweb
Copy link
Contributor

Update. For the most part your fix seems to work.
We've had one bug report related to the In Memory Provider issue though.

The bug is in this code:
Context.Table.Where(x => x.That = this).Update(y => new Item{Points = points});

This is the stacktrace.
<System.InvalidCastException: Unable to cast object of type 'Microsoft.EntityFrameworkCore.Query.Internal.InMemoryQueryContextFactory' to type 'Microsoft.EntityFrameworkCore.Query.Internal.RelationalQueryContextFactory'.
at Z.EntityFramework.Plus.InternalExtensions.GetDbContext[T](IQueryable1 source) at Z.EntityFramework.Plus.BatchUpdate.Execute[T](IQueryable1 query, Expression`1 updateFactory)
at LessonManagementService.Repository.QuizRepository.Add(WebTestQuestion webTestQuestion) in C:\repos\renweb-backendservice\ManagementService\LessonManagementService\Repository\QuizRepository.cs:line 155
at LessonManagement.Tests.Service.Repository.QuizRepositoryTests.<>c__DisplayClass7_0.<LM_QuizRepository_Add_1>b__1() in C:\repos\renweb-backendservice\Tests\LessonManagement.Tests\Service\Repository\QuizRepositoryTests.cs:line 181
at NUnit.Framework.Constraints.ThrowsConstraint.VoidInvocationDescriptor.Invoke()
at NUnit.Framework.Constraints.ThrowsConstraint.ExceptionInterceptor.Intercept(Object invocation)>

at LessonManagement.Tests.Service.Repository.QuizRepositoryTests.LM_QuizRepository_Add_1() in C:\repos\renweb-backendservice\Tests\LessonManagement.Tests\Service\Repository\QuizRepositoryTests.cs:line 181

@ksmithRenweb
Copy link
Contributor

Setting it to UpdateAsync works...

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

No branches or pull requests

2 participants