Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8403135
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T22:15:47+00:00 2026-06-09T22:15:47+00:00

I am having an issue with EF not updating my object within another thread.

  • 0

I am having an issue with EF not updating my object within another thread. I am able to retrieve objects, but when I call UnitOfWork.Commit();, SQL Server profiler doesnt show the item being updated. If I run this outside of the thread sequentially then it works fine. Any ideas?

 new Thread(() =>
                {
                    var divisionBracketsService = DependencyResolver.Current.GetService<IDivisionBracketsService>();

                    if (divisionBracketsService != null)
                        divisionBracketsService.ProcessGame(gameId);

                }).Start();

UPDATE

Well it worked when I updated the scope to thread. Are there any patterns to use both scopes?

kernel.Bind<IDatabaseFactory>().To<DatabaseFactory>().InThreadScope();

UPDATE

I noticed this question Ninject InRequestScope fallback to InThreadScope, but I am using version 3.0 of Ninject and it doesn’t contain StandardScopeCallbacks.Request.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T22:15:48+00:00Added an answer on June 9, 2026 at 10:15 pm

    From your question I see that you are not aware of the problems of starting threads in ASP.NET to make it short, IIS can decide to kill that thread at any time leaving your application in an inconsisent state. If the excecution of this thread is essential to your app then do it either syncronous, delegate it to an other process e.g. A windows service or get the knowhow how to do it correctly by registering with ASP.NET

    Using a hybrid scope is not deterministic, because at the time the thread is executed the http context may exist or not but it can be dispsed at anytime. The better way is to inject some processor class and define it as the scope for its dedencies using the named scope instead of newing a thread.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm not sure if this is a simulator issue, but I don't remeber having
I am having an issue with a directly bound ObservableCollection not updating a StackPanel
I am having an issue with implicit conversions not working under certain circumstances (higher
Hi I am having an issue with a MySQL query not passing a string
I've been having an issue with Hibernate 4 that did not happen in Hibernate
I'm using Ember 0.9.8.1 and having an issue with nested views not retaining the
I'm having a critical issue where my WAMP installation for PHP 5.3.0 is not
I'm having the craziest issue with Firefox. I'm not sure if this issue is
I'm having a linking issue with a basic C++ program. No, I'm not including
I'm having an issue with updating the database. The app shows the updated value,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.