Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Any tricks for simulating a "Connection Timeout Expired" message? Expand / Collapse
Author
Message
Posted Tuesday, April 29, 2014 2:26 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Tuesday, April 29, 2014 7:10 PM
Points: 2, Visits: 7
wondering if anyone, during their travels, has ever found a way to simulate a "Connection Timeout Expired" message.
It's to help reproduce a problem I'm trying to debug in our app, and it would be great if I could force this error at-will.

thanks in advance
Post #1566132
Posted Tuesday, April 29, 2014 3:38 PM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 9:10 AM
Points: 13,999, Visits: 28,377
Try using the WAITFOR command in T-SQL. That'll pause the execution of the query and you should see a timeout.

----------------------------------------------------
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood..." Theodore Roosevelt
The Scary DBA
Author of: SQL Server Query Performance Tuning
SQL Server 2012 Query Performance Tuning
SQL Server 2008 Query Performance Tuning Distilled
and
SQL Server Execution Plans

Product Evangelist for Red Gate Software
Post #1566156
Posted Tuesday, April 29, 2014 4:42 PM This worked for the OP Answer marked as solution


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Yesterday @ 5:27 PM
Points: 1,805, Visits: 5,863
Grant Fritchey (4/29/2014)
Try using the WAITFOR command in T-SQL. That'll pause the execution of the query and you should see a timeout.


Except that will be a Command Timeout, not a Connection Timeout.

Forcing a connection timeout could be as simple as adding a fake ip address to the hosts file on the test client machine for the DB Server, so that it never connects OR creating an alias on the client machine to achieve the same misdirection.


MM


  • MMGrid Addin
  • MMNose Addin


  • Forum Etiquette: How to post Reporting Services problems
  • Forum Etiquette: How to post data/code on a forum to get the best help - by Jeff Moden
  • How to Post Performance Problems - by Gail Shaw

  • Post #1566171
    Posted Tuesday, April 29, 2014 5:08 PM
    Forum Newbie

    Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

    Group: General Forum Members
    Last Login: Tuesday, April 29, 2014 7:10 PM
    Points: 2, Visits: 7
    Thanks both of you! I should have thought of: "Forcing a connection timeout could be as simple as adding a fake ip address to the hosts file on the test client machine for the DB Server"

    That was the ticket.

    -MK
    Post #1566177
    Posted Tuesday, April 29, 2014 6:10 PM


    SSCommitted

    SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

    Group: General Forum Members
    Last Login: Yesterday @ 5:27 PM
    Points: 1,805, Visits: 5,863
    Glad to help, and I hope your debugging goes well!

    MM


  • MMGrid Addin
  • MMNose Addin


  • Forum Etiquette: How to post Reporting Services problems
  • Forum Etiquette: How to post data/code on a forum to get the best help - by Jeff Moden
  • How to Post Performance Problems - by Gail Shaw

  • Post #1566183
    Posted Wednesday, April 30, 2014 2:49 AM


    SSChampion

    SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

    Group: General Forum Members
    Last Login: Today @ 9:10 AM
    Points: 13,999, Visits: 28,377
    mister.magoo (4/29/2014)
    Grant Fritchey (4/29/2014)
    Try using the WAITFOR command in T-SQL. That'll pause the execution of the query and you should see a timeout.


    Except that will be a Command Timeout, not a Connection Timeout.

    Forcing a connection timeout could be as simple as adding a fake ip address to the hosts file on the test client machine for the DB Server, so that it never connects OR creating an alias on the client machine to achieve the same misdirection.


    Well, the command shouldn't time out with defaults set within SQL Server, but your answer is what the OP wanted.


    ----------------------------------------------------
    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood..." Theodore Roosevelt
    The Scary DBA
    Author of: SQL Server Query Performance Tuning
    SQL Server 2012 Query Performance Tuning
    SQL Server 2008 Query Performance Tuning Distilled
    and
    SQL Server Execution Plans

    Product Evangelist for Red Gate Software
    Post #1566269
    « Prev Topic | Next Topic »

    Add to briefcase

    Permissions Expand / Collapse