Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: to handle error when remote data server is down.


Message #1 by omkarj@h... on Mon, 26 Feb 2001 07:41:06
hi,



i have a remote database.(ORACLAE 8.0)



how to handle the error. when the databse server is down..



ie,

when a user request a data from database , but the database server is down,



user is displayed a massage.



Message #2 by Craig Shields <cmorganshields@y...> on Mon, 26 Feb 2001 09:55:39 -0800 (PST)
I have the same setup and have been battling with the

exact same problem.  In our case, our web server runs

up the processes and memory to 100% within a minute

and eventually causes inetinfo to crash.  The best

I've done so far is to write an include file that

loads before any other ASP runs.  In the include (see

below), I test a connection and if there is a problem,

redirect to a "sorry - we're experiencing technical

problems..." page.  This seems to work except for that

if I shutdown the listener the code will not detect an

error for about 60 seconds!  then when the database

server comes back up, it takes about another 60

seconds to detect that it is ok.  

Hope this is of some help,

Craig





Dim tstConn

Set tstConn = Server.CreateObject("ADODB.Connection")

tstConn.CursorLocation = adUseClient

tstConn.ConnectionString = "Provider=xxxx"

tstConn.Open

If tstConn.Errors.Count <> 0 Or Err.Number <> 0 Then 

	Application.Lock 

	Application("XoErr") = true

	Application("XoStmp") = Now

	Application.UnLock 	

	Dim objErr, strErr

	If Not

InStr(Request.ServerVariables("URL"),"err.asp") > 0

Then

	

Response.Redirect("http://www.acntv.com/err.asp?db=false&Err="

& strErr)

	End If

Else

	Application.Lock 

	Application("XoErr") = False

	Application("XoStmp") = Now

	Application.UnLock

End If

Set tstConn= Nothing



--- omkarj@h... wrote:

> hi,

> 

> i have a remote database.(ORACLAE 8.0)

> 

> how to handle the error. when the databse server is

> down..

> 

> ie,

> when a user request a data from database , but the

> database server is down,

> 

> user is displayed a massage.

> 

> 

> 

> ---

> Please take a moment to tell us how you are using

> AuthentiX, WebQuota, and

> VideoQuota

> 

> http://www.flicks.com/feedback/feed.asp

> 

> Scott Gordon

> Marketing

> Flicks Software

> www.flicks.com

>  xxx-xxx-xxxx



> cmshields@k...


> $subst('Email.Unsub')

> 

> 





__________________________________________________

Do You Yahoo!?

Get email at your own domain with Yahoo! Mail. 

http://personal.mail.yahoo.com/

Message #3 by omkarj@h... on Tue, 27 Feb 2001 10:36:09
thank  Craig,



can u please tell me how to load that Include file and run before any other asp file executes.



Message #4 by Craig Shields <cmorganshields@y...> on Tue, 27 Feb 2001 09:02:11 -0800 (PST)
You just add it into you asp file somewhere outside of

your script brackets.  I usually put mine just inside

the <body> element like so:

<html>

<head>

</head>

<body>

<!-- #include file="../include/checkdb.asp"-->

<%then begin scripting%>



Craig Shields


  Return to Index