Sergy
Here's another typical DB error will get when network is down ( which happens here )
Here's the code
// BELOW WORKS FINE IF NETWORK IS UP, get err msg if Network DOWN...
// ALSO THIS IS THE VERY VERY FIRST DB call in the program...
// DB = DB2 ver 9.7 FP 11
102 sqlcmd = " select PROJECT,TITLE,HOST,DB_REGION,IISWRKDIR,IISPATH,DNS,USEDNS,VERSION,BUILD,cast(conversion_date as varchar(10)) as conv_date ," ;
103 sqlcmd += " MSXMLHTTP_VER , JSPRSRVR_URL_PORT, VULCAN_URL_PORT from NYEGEONET.projectinfo where host='" + host+ "' and db_region='" + region + "' ;" ;
104
105
106 rs=tDAL.CustomQuery(sqlcmd) ;
107 datars = CommonFunctions.db_fetch_array(rs);
108 if ( datars) {
109 XSession.Session["title"] = String.Format("{0}",datars["TITLE"]).ToUpper();
110 XSession.Session["version"] = String.Format("{0}",datars["VERSION"]).ToUpper();
111 XSession.Session["build"] = String.Format("{0}",datars["BUILD"]).ToUpper();
112 XSession.Session["d
and here's the error trying to catch and prevent
Server Error in '/nyegeo' Application.
ERROR [08001] [IBM][CLI Driver] SQL30081N A communication error has been detected. Communication protocol being used: "TCP/IP". Communication API being used: "SOCKETS". Location where the error was detected: "10.90.10.174". Communication function detecting the error: "selectForConnectTimeout". Protocol specific error code(s): "0", "", "". SQLSTATE=08001
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.Odbc.OdbcException: ERROR [08001] [IBM][CLI Driver] SQL30081N A communication error has been detected. Communication protocol being used: "TCP/IP". Communication API being used: "SOCKETS". Location where the error was detected: "10.90.10.174". Communication function detecting the error: "selectForConnectTimeout". Protocol specific error code(s): "0", "", "". SQLSTATE=08001
Source Error:
Line 241: throw e;
Line 242: }
Line 243: return null;
Line 244: }
Line 245: }
Source File: c:\inetpub\wwwroot\nyegeo\connections\Connection.cs Line: 243
Stack Trace:
[OdbcException (0x80131937): ERROR [08001] [IBM][CLI Driver] SQL30081N A communication error has been detected. Communication protocol being used: "TCP/IP". Communication API being used: "SOCKETS". Location where the error was detected: "10.90.10.174". Communication function detecting the error: "selectForConnectTimeout". Protocol specific error code(s): "0", "", "". SQLSTATE=08001
]
runnerDotNet.Connection.query(XVar sql) in c:\inetpub\wwwroot\nyegeo\connections\Connection.cs:243
System.Dynamic.UpdateDelegates.UpdateAndExecute2(CallSite site, T0 arg0, T1 arg1) +698
runnerDotNet.tDAL.CustomQuery(XVar dalSQL) in c:\inetpub\wwwroot\nyegeo\Classes\tDal.cs:17
runnerDotNet.CommonEvents.AfterAppInit() in c:\inetpub\wwwroot\nyegeo\include\CommonEvents.cs:107
CallSite.Target(Closure , CallSite , Object ) +132
System.Dynamic.UpdateDelegates.UpdateAndExecuteVoid1(CallSite site, T0 arg0) +645
runnerDotNet.appsettings.Apply() in c:\inetpub\wwwroot\nyegeo\include\appsettings.cs:923
runnerDotNet.BaseController.OnActionExecuting(ActionExecutingContext filterContext) in c:\inetpub\wwwroot\nyegeo\Controllers\BaseController.cs:65
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +53
System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +659
System.Web.Mvc.Controller.ExecuteCore() +146
runnerDotNet.BaseController.ExecuteThread(Object arg) in c:\inetpub\wwwroot\nyegeo\Controllers\BaseController.cs:45
[AggregateException: One or more errors occurred.]
runnerDotNet.BaseController.ExecuteCore() in c:\inetpub\wwwroot\nyegeo\Controllers\BaseController.cs:32
System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +91
System.Web.Mvc.<>cDisplayClassb.<BeginProcessRequest>b5() +60
System.Web.Mvc.Async.<>cDisplayClass1.<MakeVoidDelegate>b0() +25
System.Web.Mvc.<>cDisplayClasse.<EndProcessRequest>bd() +36
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +651
System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +220
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +134
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.8.4075.0