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

AsExpandable() causes "new transaction is not allowed because there are other threads running in the session.." #21

Closed
xuto2 opened this issue May 21, 2015 · 1 comment

Comments

@xuto2
Copy link

xuto2 commented May 21, 2015

Before using LINQKit, our program runs okay. After using it, I see the exception "new transaction is not allowed because there are other threads running in the session..", It looks like that AsExpandable() somehow interferes the EntityFramework's transaction management and cause EF not closing the previous transaction before starting a new one.

Note that I'm mixing the use of DbSet.AsExpandable() and EF DbSet.Where(), assuming that they're compatible with each other. Anyone notice the same issue?

@xuto2
Copy link
Author

xuto2 commented May 22, 2015

Turns out that I was using IQueryable and I was trying to create new transaction while iterating through the IQueryable, during which a connection is kept by EF and that will cause the error.

@xuto2 xuto2 closed this as completed May 22, 2015
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