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

  • SEARCH
  • Home
  • 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 9170751
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T16:04:13+00:00 2026-06-17T16:04:13+00:00

After some use in qa we get the following error Execution of the command

  • 0

After some use in qa we get the following error

Execution of the command requires an open and available connection. The connection's current state is broken.

We’re using a singleton instance of EntityFramework

SOF suggests :

EF recovery from invalidoperationexception caused by server being down

1) creating a new instance of ContectObject once in a while

2) configure the number of pool connections to be higher

What is the best practice to solve this?

I think it’s wastefull to create a new contectObject for each Dal operation

  • 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-17T16:04:14+00:00Added an answer on June 17, 2026 at 4:04 pm

    I think it’s wastefull to create a new contectObject for each Dal operation

    Do you have any evidence for this? I believe that Entity Framework and indeed most data access frameworks are designed for lots of short-lived and independent contexts. Implementing your own pooling / caching here is usually an anti-pattern, possibly resulting in stale results, concurrency issues, and poor failure recovery (as is the case here).

    What specific resources do you think will be wasted, and have you validated this experimentally?

    Basically, I would suggest creating a fresh context for each unit of work (may well correspond roughly to a request) – measure any performance differences, and see whether the problem goes away (as I expect it will). As part of your testing, occasionally disconnect the database server from the network to check that you can actually recover, too…

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

Sidebar

Related Questions

i get the following error when trying to open a second instance of emacs:
After some use Visual Studio 2008 when opening a solution that is checked into
After some experience with functional languages, I'm starting to use recursion more in Java
I hava a UITextView ,and after some characters' input, I want to use a
I've had some problems with a Django application after I deployed it. I use
Hy, i use uploadify to upload some images, after i display all the images
After some time researching and trying different things I still cannot get my @ExceptionHandler
I want to use UUID() to generate primary keys. After some investigation, I thought
I am receiving the following error message: application/libraries/GoogleMapAPI.php [2515]: Use of undefined constant ‘allow_url_fopen’
We have a Sharepoint site which uses search. We get the following error: Unable

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.