I am doing a regular update table scan
Using connect1 As New MySqlConnection(ConnectLocalhost.serverString)
connect1.Open()
Dim cmd = New MySqlCommand("set net_write_timeout=99999; set net_read_timeout=99999", connect1) ' // Setting tiimeout on mysqlServer
cmd.ExecuteNonQuery()
Dim BusinessReader = selectSomeQuery("Select * from tablebusiness limit 800,10000000", connect1)
Do While BusinessReader.Read 'random exception here
Sometimes I got this error
MySql.Data.MySqlClient.MySqlException was unhandled
ErrorCode=-2147467259
Message=Fatal error encountered during data read.
Number=0
Source=MySql.Data
StackTrace:
at MySql.Data.MySqlClient.MySqlDataReader.Read()
at dreamhost.Business.InsertLocalhost() in \\work\c\business\fromwork\currentprojects\program\library\vb.net\badger.vb:line 1849
at dreamhost.Business.surFoursquare() in \\work\c\business\fromwork\currentprojects\program\library\vb.net\badger.vb:line 1939
at dreamhost.traverseweb._Lambda$__92() in \\work\c\business\fromwork\currentprojects\program\library\vb.net\traverseweb.vb:line 77
at dreamhost.buttonClicking.startAndStopClickingButton(Object sender, Action SomeSub) in \\work\c\business\fromwork\currentprojects\program\library\vb.net\buttonclicking.vb:line 45
at dreamhost.traverseweb.foursquare_Click(Object sender, EventArgs e) in \\work\c\business\fromwork\currentprojects\program\library\vb.net\traverseweb.vb:line 77
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(ApplicationContext context)
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
at dreamhost.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException: MySql.Data.MySqlClient.MySqlException
ErrorCode=-2147467259
Message=Reading from the stream has failed.
Number=0
Source=MySql.Data
StackTrace:
at MySql.Data.MySqlClient.MySqlStream.LoadPacket()
at MySql.Data.MySqlClient.MySqlStream.ReadPacket()
at MySql.Data.MySqlClient.NativeDriver.FetchDataRow(Int32 statementId, Int32 columns)
at MySql.Data.MySqlClient.Driver.FetchDataRow(Int32 statementId, Int32 columns)
at MySql.Data.MySqlClient.ResultSet.GetNextRow()
at MySql.Data.MySqlClient.ResultSet.NextRow(CommandBehavior behavior)
at MySql.Data.MySqlClient.MySqlDataReader.Read()
InnerException: System.IO.IOException
Message=Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.
Source=MySql.Data
StackTrace:
at MyNetworkStream.HandleOrRethrowException(Exception e)
at MyNetworkStream.Read(Byte[] buffer, Int32 offset, Int32 count)
at MySql.Data.MySqlClient.TimedStream.Read(Byte[] buffer, Int32 offset, Int32 count)
at System.IO.BufferedStream.Read(Byte[] array, Int32 offset, Int32 count)
at MySql.Data.MySqlClient.MySqlStream.ReadFully(Stream stream, Byte[] buffer, Int32 offset, Int32 count)
at MySql.Data.MySqlClient.MySqlStream.LoadPacket()
InnerException: System.Net.Sockets.SocketException
ErrorCode=10054
Message=An existing connection was forcibly closed by the remote host
NativeErrorCode=10054
Source=System
StackTrace:
at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
InnerException:
All I want is for the program to just "continue" when this thing happen. But that seems to be impossible. So I guess I need a way to make sure this bug doesn't happen. It happens randomly eery 800 entries or so.
Looks to me the connection is forcibly closed by remote host. In that case, I simply want to go where things left on and restart again.
There may be a lot of reasons why the connection drops (server load, network problem, etc). That your program is crashing suggests that your database code is not protected by a try statement. If you do something like this :
try
Using connect1 As New MySqlConnection(ConnectLocalhost.serverString)
connect1.Open()
Dim cmd = New MySqlCommand("set net_write_timeout=99999; _
set net_read_timeout=99999", connect1)
cmd.ExecuteNonQuery()
Dim BusinessReader = selectSomeQuery("Select *...", connect1)
Do While BusinessReader.Read
'random exception here'
'...more code'
Loop
End Using
Catch ex As Exception
' code breaks here on exception - recover from this point '
End Try
I won't go into a protracted dissertation on exception handling but there are a lot of resources out there if you have a look. How you deal with it will depend on your specific situation - whether to log the exception, record what the last successful operation was, whether to try to resume from where you were or whether to try to do the whole thing over again, notify the user, etc.
MSDN - Try/Catch/Finally
Related
I get this error when I publish the website on windows server 2003.
.Net framework version is 3.5. MySQL connector is 6.7.9.
I tried to add System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Ssl3
to the global file in application_start
System.IO.IOException: Received an unexpected EOF or 0 bytes from the transport stream. at System.Net.FixedSizeReader.ReadPacket(Byte[] buffer, Int32 offset, Int32 count) at System.Net.Security.SslState.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.ForceAuthentication(Boolean receiveFirst, Byte[] buffer, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.ProcessAuthentication(LazyAsyncResult lazyResult) at MySql.Data.MySqlClient.NativeDriver.StartSSL() at MySql.Data.MySqlClient.NativeDriver.Open() at MySql.Data.MySqlClient.Driver.Open() at MySql.Data.MySqlClient.Driver.Create(MySqlConnectionStringBuilder settings) at MySql.Data.MySqlClient.MySqlPool.GetPooledConnection() at MySql.Data.MySqlClient.MySqlPool.TryToGetDriver() at MySql.Data.MySqlClient.MySqlPool.GetConnection() at MySql.Data.MySqlClient.MySqlConnection.Open() at pcounter.report.Page_Load(Object sender, EventArgs e) in C:\Users\aisied\Documents\Github\pcounter\pcounter\report.aspx.vb:line 20
Adding sslmode=none to connection string solved the problem.
I got this error massage in MySQL, it was not blocked by firewall/anti-virus software. It happened when some task which is resource-intensive was launched.
Someone mention that it may cause by process priority issue
https://bugs.mysql.com/bug.php?id=76597
How can I do?
Error Msg:
MySql.Data.MySqlClient.MySqlException (0x80004005): Authentication to host 'localhost' for user 'xxx' using method 'mysql_native_password' failed with message: Reading from the stream has failed.
---> MySql.Data.MySqlClient.MySqlException (0x80004005): Reading from the stream has failed.
---> System.IO.IOException: Unable to read data from the transport connection: An established connection was aborted by the software in your host machine.
---> System.Net.Sockets.SocketException: An established connection was aborted by the software in your host machine
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
--- End of inner exception stack trace ---
at MySql.Data.Common.MyNetworkStream.HandleOrRethrowException(Exception e)
at MySql.Data.Common.MyNetworkStream.Read(Byte[] buffer, Int32 offset, Int32 count)
at MySql.Data.MySqlClient.TimedStream.Read(Byte[] buffer, Int32 offset, Int32 count)
at System.IO.BufferedStream.Read(Byte[] array, Int32 offset, Int32 count)
at MySql.Data.MySqlClient.MySqlStream.ReadFully(Stream stream, Byte[] buffer, Int32 offset, Int32 count)
at MySql.Data.MySqlClient.MySqlStream.LoadPacket()
at MySql.Data.MySqlClient.MySqlStream.LoadPacket()
at MySql.Data.MySqlClient.MySqlStream.ReadPacket()
at MySql.Data.MySqlClient.Authentication.MySqlAuthenticationPlugin.ReadPacket()
at MySql.Data.MySqlClient.Authentication.MySqlAuthenticationPlugin.AuthenticationFailed(Exception ex)
at MySql.Data.MySqlClient.Authentication.MySqlAuthenticationPlugin.ReadPacket()
at MySql.Data.MySqlClient.Authentication.MySqlAuthenticationPlugin.Authenticate(Boolean reset)
at MySql.Data.MySqlClient.NativeDriver.Open()
at MySql.Data.MySqlClient.Driver.Open()
at MySql.Data.MySqlClient.Driver.Create(MySqlConnectionStringBuilder settings)
at MySql.Data.MySqlClient.MySqlPool.CreateNewPooledConnection()
at MySql.Data.MySqlClient.MySqlPool.GetPooledConnection()
at MySql.Data.MySqlClient.MySqlPool.TryToGetDriver()
at MySql.Data.MySqlClient.MySqlPool.GetConnection()
at MySql.Data.MySqlClient.MySqlConnection.Open()
at SecureDockDataAccess.DBAccess.Execute(String sql)
I have a MS Exchange 2013 server that worked fine until I installed CU9 KB3087126.
Issues:
ECP is not accesible from the outside.
ECP is accessible from the inside using "https://server_name/ecp" but after entering the credentials I get a page with "Server Error in '/ecp' Application."
Could not load file or assembly 'Microsoft.Exchange.Common, Version=15.0.0.0, Culture=neutral, PublicKeyToken=token_here' or one of its dependencies. The system cannot find the file specified.
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.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Exchange.Common, Version=15.0.0.0, Culture=neutral, PublicKeyToken=token_here' or one of its dependencies. The system cannot find the file specified.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Assembly Load Trace: The following information can be helpful to determine why the assembly 'Microsoft.Exchange.Common, Version=15.0.0.0, Culture=neutral, PublicKeyToken=token_here' could not be loaded.
WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
Stack Trace:
[FileNotFoundException: Could not load file or assembly 'Microsoft.Exchange.Common, Version=15.0.0.0, Culture=neutral, PublicKeyToken=token_here' or one of its dependencies. The system cannot find the file specified.]
System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName, ObjectHandleOnStack type) +0
System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName) +153
System.Type.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase) +63
System.Web.Compilation.BuildManager.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase) +124
System.Web.Configuration.ConfigUtil.GetType(String typeName, String propertyName, ConfigurationElement configElement, XmlNode node, Boolean checkAptcaBit, Boolean ignoreCase) +76
>[ConfigurationErrorsException: Could not load file or assembly 'Microsoft.Exchange.Common, Version=15.0.0.0, Culture=neutral, PublicKeyToken=token_here' or one of its dependencies. The system cannot find the file specified.]
System.Web.Configuration.ConfigUtil.GetType(String typeName, String propertyName, ConfigurationElement configElement, XmlNode node, Boolean checkAptcaBit, Boolean ignoreCase) +12425660
System.Web.Configuration.Common.ModulesEntry.SecureGetType(String typeName, String propertyName, ConfigurationElement configElement) +69
System.Web.Configuration.Common.ModulesEntry..ctor(String name, String typeName, String propertyName, ConfigurationElement configElement) +62
System.Web.HttpApplication.BuildIntegratedModuleCollection(List`1 moduleList) +299
System.Web.HttpApplication.GetModuleCollection(IntPtr appContext) +1262
System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +133
System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +304
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +404
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +475
[HttpException (0x80004005): Could not load file or assembly 'Microsoft.Exchange.Common, Version=15.0.0.0, Culture=neutral, PublicKeyToken=token_here' or one of its dependencies. The system cannot find the file specified.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +12618996
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +159
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +12458613
In the Event log I have a WARNING from ASP.NET 4.0.30319.0 with EventID 1310 saying:
Event code: 3008
Event message: A configuration error has occurred.
Event time: 7/20/2016 2:34:28 PM
Event time (UTC): 7/20/2016 11:34:28 AM
Event ID: a59d5b2b449a4b968766e110bc5704a6
Event sequence: 1
Event occurrence: 1
Event detail code: 0
Application information:
Application domain: /LM/W3SVC/2/ROOT/ecp-12-131134880684035632
Trust level: Full
Application Virtual Path: /ecp
Application Path: C:\Program Files\Microsoft\Exchange Server\V15\ClientAccess\ecp\
Machine name: name_here
Process information:
Process ID: 11208
Process name: w3wp.exe
Account name: NT AUTHORITY\SYSTEM
Exception information:
Exception type: ConfigurationErrorsException
Exception message: Could not load file or assembly 'Microsoft.Exchange.Common, Version=15.0.0.0, Culture=neutral, PublicKeyToken=token_here' or one of its dependencies. The system cannot find the file specified.
at System.Web.Configuration.ConfigUtil.GetType(String typeName, String propertyName, ConfigurationElement configElement, XmlNode node, Boolean checkAptcaBit, Boolean ignoreCase)
at System.Web.Configuration.Common.ModulesEntry.SecureGetType(String typeName, String propertyName, ConfigurationElement configElement)
at System.Web.Configuration.Common.ModulesEntry..ctor(String name, String typeName, String propertyName, ConfigurationElement configElement)
at System.Web.HttpApplication.BuildIntegratedModuleCollection(List`1 moduleList)
at System.Web.HttpApplication.GetModuleCollection(IntPtr appContext)
at System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers)
at System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context)
at System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context)
at System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext)
>Could not load file or assembly 'Microsoft.Exchange.Common, Version=15.0.0.0, Culture=neutral, PublicKeyToken=token_here' or one of its dependencies. The system cannot find the file specified.
at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName, ObjectHandleOnStack type)
at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName)
at System.Type.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase)
at System.Web.Compilation.BuildManager.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase)
at System.Web.Configuration.ConfigUtil.GetType(String typeName, String propertyName, ConfigurationElement configElement, XmlNode node, Boolean checkAptcaBit, Boolean ignoreCase)
Request information:
Request URL: https://localhost:444/ecp/exhealth.check
Request path: /ecp/exhealth.check
User host address: ::1
User:
Is authenticated: False
Authentication Type:
Thread account name: NT AUTHORITY\SYSTEM
Thread information:
Thread ID: 35
Thread account name: NT AUTHORITY\SYSTEM
Is impersonating: False
Stack trace: at System.Web.Configuration.ConfigUtil.GetType(String typeName, String propertyName, ConfigurationElement configElement, XmlNode node, Boolean checkAptcaBit, Boolean ignoreCase)
at System.Web.Configuration.Common.ModulesEntry.SecureGetType(String typeName, String propertyName, ConfigurationElement configElement)
at System.Web.Configuration.Common.ModulesEntry..ctor(String name, String typeName, String propertyName, ConfigurationElement configElement)
at System.Web.HttpApplication.BuildIntegratedModuleCollection(List`1 moduleList)
at System.Web.HttpApplication.GetModuleCollection(IntPtr appContext)
at System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers)
at System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context)
at System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context)
at System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext)
In the Queue Viewer I have a lot of emails headed towards certain domains that are stuck with the error:
[{LRT=7/20/2016 2:40:17 PM};{LED=450 4.7.0 Proxy session setup failed on Frontend with '451 4.4.0 DNS query failed. The error was: DNS query failed with error ServerFailure'};{FQDN=correct_fqdn_here};{IP=correct_ip}]
What works:
OWA works from the inside and outside;
Apart from some emails to specific domains (small companies) inbound/outbound emails work from inside and outside of the company.(Tested with a Gmail account, testconnectivity.microsoft.com and received confirmation that emails from some big companies are being received - ex. hp.com)
Apart from the CU9 Update, nothing was changed prior to the update.
Searched the web a lot before asking but nothing helped. I'm guessing most of the issues are because ECP is not working.
Has anyone encountered this issue before and has an idea how to fix it?
Thanks in advance!
After a lot of research I ended up rebuilding the .net folders and AppPool entities in IIS. The main issue being that the IIS AppPools were not pointing to the correct ECP site, etc.
Now it works just fine.
I have an Entity Framework-based application running in production.
Since a couple of days some customers are calling for random Internal Server Errors. Log files show that a simple transaction, with a single INSERT statement, is failing to commit, and that transaction is related to logging.
Let me explain better....
I have inherited a database logging feature that thanks to a controller method attribute will log every HTTP request to database to make a navigation log. Last year I have refactored the whole application from plain old multi-dialect SQL/ADO (because app runs on both MySQL and SQL Server) to Entity Framework. The application went in production and only little maintenance was required, up to major release 3.0 which is in prod for more than a month.
From yesterday, we received multiple complaints that I found related to the following exception
System.Data.Entity.Infrastructure.CommitFailedException: [non-English description] http://go.microsoft.com/fwlink/?LinkId=313468. ---> MySql.Data.MySqlClient.MySqlException: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. ---> System.TimeoutException: Timeout in IO operation
in MySql.Data.MySqlClient.TimedStream.StopTimer()
in MySql.Data.MySqlClient.TimedStream.Read(Byte[] buffer, Int32 offset, Int32 count)
in System.IO.BufferedStream.Read(Byte[] array, Int32 offset, Int32 count)
in MySql.Data.MySqlClient.MySqlStream.ReadFully(Stream stream, Byte[] buffer, Int32 offset, Int32 count)
in MySql.Data.MySqlClient.MySqlStream.LoadPacket()
in MySql.Data.MySqlClient.MySqlStream.ReadPacket()
in MySql.Data.MySqlClient.NativeDriver.GetResult(Int32& affectedRow, Int64& insertedId)
in MySql.Data.MySqlClient.Driver.NextResult(Int32 statementId, Boolean force)
in MySql.Data.MySqlClient.MySqlDataReader.NextResult()
in MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior)
--- Fine della traccia dello stack dell'eccezione interna ---
in MySql.Data.MySqlClient.ExceptionInterceptor.Throw(Exception exception)
in MySql.Data.MySqlClient.MySqlConnection.HandleTimeoutOrThreadAbort(Exception ex)
in MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior)
in MySql.Data.MySqlClient.MySqlCommand.ExecuteNonQuery()
in MySql.Data.MySqlClient.MySqlTransaction.Commit()
in System.Data.Entity.Infrastructure.Interception.InternalDispatcher`1.Dispatch[TTarget,TInterceptionContext](TTarget target, Action`2 operation, TInterceptionContext interceptionContext, Action`3 executing, Action`3 executed)
--- Fine della traccia dello stack dell'eccezione interna ---
in System.Data.Entity.Infrastructure.Interception.InternalDispatcher`1.Dispatch[TTarget,TInterceptionContext](TTarget target, Action`2 operation, TInterceptionContext interceptionContext, Action`3 executing, Action`3 executed)
in System.Data.Entity.Infrastructure.Interception.DbTransactionDispatcher.Commit(DbTransaction transaction, DbInterceptionContext interceptionContext)
in System.Data.Entity.Core.EntityClient.EntityTransaction.Commit()
in System.Data.Entity.Core.Objects.ObjectContext.ExecuteInTransaction[T](Func`1 func, IDbExecutionStrategy executionStrategy, Boolean startLocalTransaction, Boolean releaseConnectionOnSuccess)
in System.Data.Entity.Core.Objects.ObjectContext.SaveChangesToStore(SaveOptions options, IDbExecutionStrategy executionStrategy, Boolean startLocalTransaction)
in System.Data.Entity.Core.Objects.ObjectContext.SaveChangesInternal(SaveOptions options, Boolean executeInExistingTransaction)
in System.Data.Entity.Internal.InternalContext.SaveChanges()
in DiagnosticoSite.Data.Managers.Spring.NavigationLogManagerImpl.Insert(String aUserId, DateTime aRequestDate, String aPath, String aQuery, String aHost, String aBrowser, String aExecutionTime)
The code
Code that runs the query is extremely simple
public void Insert(string aUserId, DateTime aRequestDate, string aPath, string aQuery, string aHost, string aBrowser, string aExecutionTime)
{
using (MyContext dataContext = GetDataContext())
{
LogNavigation log = new LogNavigation
{
LN_RequestDate = aRequestDate,
LN_Path = aPath,
LN_Query = aQuery,
LN_Host = aHost,
LN_Browser = aBrowser,
LN_ExecutionTime = aExecutionTime,
LN_FK_Utenti = aUserId
};
dataContext.log_navigation.Add(log);
dataContext.SaveChanges();
}
}
GetDataContext() is a Spring lookup method that returns new MyDataContext() as a Spring prototype object.
The application is DB-heavy, in the sense that it normally runs queries that take up to minutes to complete, but those readonly queries and the log navigation queries reasonably run on different connections/transactions.
What I have tried
Currently DB timeout is very high. Following is Spring XML configuration
<object id="DataContext" singleton="false" type="MyPackage.MyDataContext, MyAssembly" >
<property name="Database.CommandTimeout" value="3600" />
<property name="Configuration.UseDatabaseNullSemantics" value="true" />
</object>
I have also tried to investigate slow-query-log without finding any INSERT
Workaround
Currently the workaround to this issue was to try-catch the logging facility and log possible exception to log4net's system log. But that is a workaround. Like when you take a painkiller instead of properly treating an inflammation I mean.
The question is
How do I investigate the root cause of such timeouts during the execution of a single-statement transaction?
I'm trying to put exception handling into my working orchestration and cannot get the exception caught. It keeps suspending the message instead of executing my exception block to handle it more gracefully.
Any suggestions?
Here are the event log messages I'm getting:
A message sent to adapter "WCF-Custom" on send port "InsertOracleMasterPort" with URI "oracledb://svd0odbd01:1529/ebsdev/Dedicated" is suspended.
Error details: Microsoft.ServiceModel.Channels.Common.ConnectionException: ORA-1017: invalid username/password; logon denied ---> Oracle.DataAccess.Client.OracleException: ORA-1017: invalid username/password; logon denied
at Oracle.DataAccess.Client.OracleException.HandleErrorHelper(Int32 errCode, OracleConnection conn, IntPtr opsErrCtx, OpoSqlValCtx* pOpoSqlValCtx, Object src, String procedure, Boolean bCheck)
at Oracle.DataAccess.Client.OracleException.HandleError(Int32 errCode, OracleConnection conn, IntPtr opsErrCtx, Object src)
at Oracle.DataAccess.Client.OracleConnection.Open()
at Microsoft.Adapters.OracleCommon.OracleCommonConnectionWrapper..ctor(String connectionString, OracleCommonExecutionHelper executionHelper)
at Microsoft.Adapters.OracleDB.OracleDBConnection.Microsoft.ServiceModel.Channels.Common.IConnection.Open(TimeSpan timeout)
--- End of inner exception stack trace ---
Server stack trace:
at Microsoft.Adapters.OracleDB.OracleDBConnection.Microsoft.ServiceModel.Channels.Common.IConnection.Open(TimeSpan timeout)
at Microsoft.ServiceModel.Channels.Common.Design.ConnectionPool.GetConnection(Guid clientId, TimeSpan timeout)
at Microsoft.ServiceModel.Channels.Common.Design.ConnectionPool.GetConnectionHandler[TConnectionHandler](Guid clientId, TimeSpan timeout, MetadataLookup metadataLookup, String& connectionId)
at Microsoft.ServiceModel.Channels.Common.Channels.AdapterRequestChannel.OnOpen(TimeSpan timeout)
at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.OnOpen(TimeSpan timeout)
at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
at System.ServiceModel.Channels.CommunicationObject.Open()
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at System.ServiceModel.ICommunicationObject.Open()
at Microsoft.BizTalk.Adapter.Wcf.Runtime.WcfClient`2.GetChannel[TChannel](IBaseMessage bizTalkMessage, ChannelFactory`1& cachedFactory)
at Microsoft.BizTalk.Adapter.Wcf.Runtime.WcfClient`2.SendMessage(IBaseMessage bizTalkMessage)
MessageId: {1CC95FB3-E543-4011-9BDD-EABB50B75BC2}
InstanceID: {EF352982-D16C-421E-806C-58E432049951}
Second message:
xlang/s engine event log entry: Uncaught exception (see the 'inner exception' below) has suspended an instance of service 'Orchestrations.OracleInvoice(868ee765-7874-ec30-0cc7-f81ae5ebfb2b)'.
The service instance will remain suspended until administratively resumed or terminated.
If resumed the instance will continue from its last persisted state and may re-throw the same unexpected exception.
InstanceId: 7eefaf7e-0e9c-4ee6-be6e-7030ece2058b
Shape name:
ShapeId:
Exception thrown from: segment -1, progress -1
Inner exception: An error occurred while processing the message, refer to the details section for more information
Message ID: {1CC95FB3-E543-4011-9BDD-EABB50B75BC2}
Instance ID: {EF352982-D16C-421E-806C-58E432049951}
Error Description: Microsoft.ServiceModel.Channels.Common.ConnectionException: ORA-1017: invalid username/password; logon denied ---> Oracle.DataAccess.Client.OracleException: ORA-1017: invalid username/password; logon denied
at Oracle.DataAccess.Client.OracleException.HandleErrorHelper(Int32 errCode, OracleConnection conn, IntPtr opsErrCtx, OpoSqlValCtx* pOpoSqlValCtx, Object src, String procedure, Boolean bCheck)
at Oracle.DataAccess.Client.OracleException.HandleError(Int32 errCode, OracleConnection conn, IntPtr opsErrCtx, Object src)
at Oracle.DataAccess.Client.OracleConnection.Open()
at Microsoft.Adapters.OracleCommon.OracleCommonConnectionWrapper..ctor(String connectionString, OracleCommonExecutionHelper executionHelper)
at Microsoft.Adapters.OracleDB.OracleDBConnection.Microsoft.ServiceModel.Channels.Common.IConnection.Open(TimeSpan timeout)
--- End of inner exception stack trace ---
Server stack trace:
at Microsoft.Adapters.OracleDB.OracleDBConnection.Microsoft.ServiceModel.Channels.Common.IConnection.Open(TimeSpan timeout)
at Microsoft.ServiceModel.Channels.Common.Design.ConnectionPool.GetConnection(Guid clientId, TimeSpan timeout)
at Microsoft.ServiceModel.Channels.Common.Design.ConnectionPool.GetConnectionHandler[TConnectionHandler](Guid clientId, TimeSpan timeout, MetadataLookup metadataLookup, String& connectionId)
at Microsoft.ServiceModel.Channels.Common.Channels.AdapterRequestChannel.OnOpen(TimeSpan timeout)
at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.OnOpen(TimeSpan timeout)
at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
at System.ServiceModel.Channels.CommunicationObject.Open()
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at System.ServiceModel.ICommunicationObject.Open()
at Microsoft.BizTalk.Adapter.Wcf.Runtime.WcfClient`2.GetChannel[TChannel](IBaseMessage bizTalkMessage, ChannelFactory`1& cachedFactory)
at Microsoft.BizTalk.Adapter.Wcf.Runtime.WcfClient`2.SendMessage(IBaseMessage bizTalkMessage)
Exception type: XlangSoapException
Source: Microsoft.XLANGs.BizTalk.Engine
Target Site: Void VerifyTransport(Microsoft.XLANGs.Core.Envelope, Int32, Microsoft.XLANGs.Core.Context)
The following is a stack trace that identifies the location where the exception occured
at Microsoft.BizTalk.XLANGs.BTXEngine.BTXPortBase.VerifyTransport(Envelope env, Int32 operationId, Context ctx)
at Microsoft.XLANGs.Core.Subscription.Receive(Segment s, Context ctx, Envelope& env, Boolean topOnly)
at Microsoft.XLANGs.Core.PortBase.GetMessageId(Subscription subscription, Segment currentSegment, Context cxt, Envelope& env, CachedObject location)
at Orchestrations.OracleInvoice.segment2(StopConditions stopOn)
at Microsoft.XLANGs.Core.SegmentScheduler.RunASegment(Segment s, StopConditions stopCond, Exception& exp)
Here's the orchestration:
The catch blocks use these types of error objects:
System.Web.Services.Protocols.SoapException
Microsoft.XLANGs.Core.XlangSoapException
Microsoft.XLANGs.BaseTypes.XLANGsException
General Exception
System.Exception
I thought the exception handling would bubble up and be caught in the system.exception or general handlers but that doesn't happen.
based on those posts it look like you need to create and catch wcf fault exeption
example 1
example 2