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 7638517
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T08:11:47+00:00 2026-05-31T08:11:47+00:00

Service dependency is not enough to guarantee that database clients will find their SQL

  • 0

Service dependency is not enough to guarantee that database clients will find their SQL Server up and running after a system reboot. They may be able to create a connection to the master database, but a specific database may still be in the process of opening (in the recovery mode) and connections to it will be refused for some initial period of time.

The exact duration of the delay is highly variable and depends on factors such as number of databases on the system, recovery mode, LDF file size, or traffic prior to the reboot.

The well known approach to dealing with the dependency on the client is sleeping and retrying. However, this approach does not seem exactly clean or reliable, especially when the clients are diverse in terms of technology and ownership and when this race condition appears only very rarely.

Is there any better way to synchronize the clients with the server start-up, ideally through keeping the SQL Server service in the “Starting” state until all databases have been either opened or marked suspect?

  • 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-05-31T08:11:48+00:00Added an answer on May 31, 2026 at 8:11 am

    Create a windows service that tries to access the database which does not report itself as having started unless successful in establishing a reliable connection. Basically that service would return an error and the service manager would try to run it according to the service settings.

    And now you can depend on that new service in your other services that would guarantee that the database is responsive.

    Related questions

    • In C# what is the best way to determine if a database is up and running?

    Update

    Also, for a much cleaner way to know if the database is up and running is to check the following value:

    SELECT state_desc
    FROM sys.databases
    WHERE name = 'YourDatabase'
    

    If it says anything but ‘ONLINE’, then the database is not yet ready. (if it exists at all)
    http://msdn.microsoft.com/en-us/library/ms190442.aspx

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

Sidebar

Related Questions

I have a service that has a dependency on SQL server express (2005). Every
My service communicates with a server that manages accounts. Each Account has a cap
I've built a semi-push service (checkins for notifications from a centralized http server) that
I have a service (Service1) that uses another serice (Service2). I am using Dependency
I am hearing people say you should not use Service Locator for your Dependency
I have a SQL Server 2005 Service Broker queue ProductChangeMessages and a Service Broker
I have a Windows Service project, A, with a dependency on a class library
I have a C# based service that is dependent on the MSMQ service. In
Add service reference to Amazon service fails, saying Could not load file or assembly
Sql Service Broker uses the following heuristic to determine when you have messages in

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.