I have an application that sometimes throws a SAException i cant figure out what means. It is a windows service written in c# (.net 4) using iAnywhere.Data.SQLAnywhere.v4.0 (v4.0.30319) I have the following code that is called for logging this exception private static void LogSAException(SAException ex) { log.ErrorFormat("SAException: (Logging everything)"); string tmp = ""; foreach (var kvp in ex.Data.Keys) { tmp += kvp + ":" + ex.Data[kvp] + "\r\n"; } log.ErrorFormat("SAException Data: {0}", tmp); log.ErrorFormat("SAException ex.ErrorCode: {0}", ex.ErrorCode); tmp = ""; foreach (SAError kvp in ex.Errors) { tmp += "Message: " + kvp.Message + ", NativeError: " + kvp.NativeError + ", Source: " + kvp.Source + ", SqlState: " + kvp.SqlState; } log.ErrorFormat("SAException Errors: {0}", tmp); log.ErrorFormat("SAException HelpLink: {0}", ex.HelpLink); log.ErrorFormat("SAException Message: {0}", ex.Message); log.ErrorFormat("SAException InnerException: {0}", ex.InnerException); log.ErrorFormat("SAException NativeError: {0}", ex.NativeError); log.ErrorFormat("SAException Source: {0}", ex.Source); log.ErrorFormat("SAException StackTrace: {0}", ex.StackTrace); } My log shows this: 2013-12-14 12:06:50,115 [12] ERROR ... [(null)] - SAException: (Logging everything) 2013-12-14 12:06:50,146 [12] ERROR ... [(null)] - SAException Data: 2013-12-14 12:06:50,146 [12] ERROR ... [(null)] - SAException ex.ErrorCode: -2147467259 2013-12-14 12:06:50,146 [12] ERROR ... [(null)] - SAException Errors: Message: Communication error, NativeError: -85, Source: SQL Anywhere .NET Data Provider, SqlState: 08S01 2013-12-14 12:06:50,161 [12] ERROR ... [(null)] - SAException HelpLink: 2013-12-14 12:06:50,161 [12] ERROR ... [(null)] - SAException Message: Communication error 2013-12-14 12:06:50,161 [12] ERROR ... [(null)] - SAException InnerException: 2013-12-14 12:06:50,161 [12] ERROR ... [(null)] - SAException NativeError: -85 2013-12-14 12:06:50,177 [12] ERROR ... [(null)] - SAException Source: SQL Anywhere .NET Data Provider 2013-12-14 12:06:50,177 [12] ERROR ... [(null)] - SAException StackTrace: at iAnywhere.Data.SQLAnywhere.SACommand._Prepare() at iAnywhere.Data.SQLAnywhere.SACommand.Prepare() at ....DBDao.FindDeltakere(Transaction transaction) ...\DAO\DBDao.cs:line 216 The problem only shows up now and then. How do i debug this? asked 16 Dec '13, 03:29 Audun |
The error:
Message: Communication error, NativeError: -85, Source: SQL Anywhere .NET Data Provider, SqlState: 08S01
in the documentation indicates:
-85 : Communication error There is a communication problem between the application and the server.
So there is possibly an issue with your communication link, or the server may have gone down, or there may be another software issue.
Which version and build of SQL Anywhere and the ADO.NET provider are you using (e.g. 12.0.1.3994)? What does the console output (
dbsrvX -z -o console.txt
) of the database server say when this happens?