spacedeveloper
Programmer
Hi everyone,
I've been working on trying to track down a problem for days now and was wondering if someone may be able to help me on this one.
I am trying to make a call to a sql server stored proc that takes a property id (we work in the hotel industry) and pings the property's server to see if it is down.
when I run the stored proc directly from sql server the result comes back right away (including from a propertyid whose server is down). However, when I run the script that called the stored proc (with a propertyid that is down) the page takes several minutes to refresh and many times just times out. I wonder why? We can't ask a customer to wait that long on a page...they'll just go somewhere else.
Can anyone find the problem?
Thank you very much!!
P.S. The page works fine with properties whose server is up and running and returns a ping.
I've been working on trying to track down a problem for days now and was wondering if someone may be able to help me on this one.
I am trying to make a call to a sql server stored proc that takes a property id (we work in the hotel industry) and pings the property's server to see if it is down.
when I run the stored proc directly from sql server the result comes back right away (including from a propertyid whose server is down). However, when I run the script that called the stored proc (with a propertyid that is down) the page takes several minutes to refresh and many times just times out. I wonder why? We can't ask a customer to wait that long on a page...they'll just go somewhere else.
Can anyone find the problem?
Thank you very much!!
P.S. The page works fine with properties whose server is up and running and returns a ping.
Code:
'************************************************* ********
Dim ExecuteCodeBlock
ExecuteCodeBlock = True
If ExecuteCodeBlock Then
Dim propSelect, firstPar, secondPar, PropertyID, PropertyIP
' Get propid from selected property dropdown
propSelect = request.form("HotID")
firstPar = InStr(propSelect, "(")
secondPar = InStr(propSelect, ")")
PropertyID = Mid(propSelect, firstPar + 1, secondPar - firstPar - 1)
If firstPar = "" Or secondPar = "" Or PropertyID = "" Then
' Selected dropdown property does not have any propid
Else
Dim pingsql, rsPing, connPing, down, strPingResults
pingsql = "exec sp_PingProperty '" & PropertyID & "'"
Set rsPing = Server.CreateObject("ADODB.RecordSet")
Set connPing = Server.CreateObject("ADODB.Connection")
connPing.ConnectionTimeout = 20
connPing.CommandTimeout = 30
connPing.Open(strConn)
down = True
Set rsPing = connPing.Execute(pingsql)
rsPing.MoveFirst
Do While Not rsPing.EOF
strPingResults = LCase(rsPing("output"))
If InStr(strPingResults, "reply") Then
down = False
Exit Do
Else
down = True
End If
rsPing.MoveNext
Loop
rsPing.Close
connPing.Close
Set rsPing = Nothing
Set connPing = Nothing
If down = True Then
If system = "TEST" Then
Response.Write ("<script type='text/javascript'>alert('We apologize! The property location you selected is experiencing technical difficulties. \n\rWe are working to resolve the issue. Please try your online payment again later.'); window.location = '//[TEST Hotel]/[page].asp';</script>")
Else
Response.Write ("<script type='text/javascript'>alert('We apologize! The property location you selected is experiencing technical difficulties. \n\rWe are working to resolve the issue. Please try your online payment again later.'); window.location = '[URL unfurl="true"]https://www.[/URL][LIVE Hotel].com/[page].asp';</script>")
End If
End If
End If
End If
'*******************************************