Background Thread Unhandled InvalidOperationException

Background Thread Unhandled InvalidOperationException

Postby crazypit » Tue 15 Mar 2011 11:01

Hello,

At the system described in article http://www.devart.com/forums/viewtopic.php?t=19337 and using the latest LinqConnect version i got the following unhandled internal exception:

Application: Exis.eXray.AppServerService.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.InvalidOperationException
Stack:
at Devart.Common.DbConnectionInternal.d(System.Object)
at Devart.Common.DbConnectionPoolGroup.a(Devart.Common.DbConnectionPool)
at Devart.Common.DbConnectionPoolGroup.a(System.Object)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading._TimerCallback.PerformTimerCallback(System.Object)

It is the first time i get one of these. I will let you know about the frequency. In any case, i need this exception to be catched in your code because it crashes our entire CRM server.
crazypit
 
Posts: 163
Joined: Wed 15 Apr 2009 08:43

Postby StanislavK » Wed 16 Mar 2011 15:36

Could you please specify the following:
- whether the problem occurred in the Direct or OCI connection mode;
- an approximate connection string, especially the parameters related to pooling.

If possible, please send us a small project with which the issue can be reproduced.

Also, please tell us if the problem occurs again.
StanislavK
Devart Team
 
Posts: 1710
Joined: Thu 03 Dec 2009 10:48

Postby crazypit » Mon 21 Mar 2011 12:24

The problem occured in OCI mode. Pooling is enabled with min connections set to 10 and max connections set to 100. System is RAC enabled with 2 nodes. Cannot send a test project as this is a rather complex configuration on which it happens as described at the other, related article. It's been a week now and it didn't occur and it didn't occur before that. It seems to be a one-timer. I will let you know if it gets persistent.
crazypit
 
Posts: 163
Joined: Wed 15 Apr 2009 08:43

Postby crazypit » Wed 23 Mar 2011 16:02

A second exception is encountered and caused the system to crash:

Application: Exis.eXray.AppServerService.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.AccessViolationException
Stack:
at OciDynamicType.nativeOCIHandleFree(System.Runtime.InteropServices.HandleRef, Int32)
at OciDynamicType.OCIHandleFree(System.Runtime.InteropServices.HandleRef, Int32)
at Devart.Data.Oracle.a.b(System.Object)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
at System.Threading.ThreadHelper.ThreadStart(System.Object)

It seems that this kind of errors are raised under stress.
crazypit
 
Posts: 163
Joined: Wed 15 Apr 2009 08:43

Postby crazypit » Thu 24 Mar 2011 07:41

The second exception happened again yesterday...
crazypit
 
Posts: 163
Joined: Wed 15 Apr 2009 08:43

Postby StanislavK » Thu 24 Mar 2011 13:03

Please specify the product you are using (LinqConnect or dotConnect for Oracle) and its exact version number. We will prepare a test build that should help localizing the problem.
StanislavK
Devart Team
 
Posts: 1710
Joined: Thu 03 Dec 2009 10:48

Postby crazypit » Thu 24 Mar 2011 13:19

We are using LinqConnect version 2.20.11.
crazypit
 
Posts: 163
Joined: Wed 15 Apr 2009 08:43

Postby StanislavK » Thu 24 Mar 2011 15:34

We will inform you when the test build is available.
StanislavK
Devart Team
 
Posts: 1710
Joined: Thu 03 Dec 2009 10:48

Postby StanislavK » Fri 01 Apr 2011 11:48

We've done some code changes. An OracleException is now created and passed to the main thread in such situation, so that it is possible to catch and process this exception.

These changes will be available in the nearest build, which we plan to release in about a week. We will post here when this build is available.
StanislavK
Devart Team
 
Posts: 1710
Joined: Thu 03 Dec 2009 10:48

Postby StanislavK » Thu 07 Apr 2011 17:04

We have released the new 6.10.135 build of dotConnect for Oracle which includes the changes mentioned above. Please try this build and tell us if this fixes the problem with unhandled AccessViolationException.

dotConnect for Oracle 6.10.135 can be downloaded from
http://www.devart.com/dotconnect/oracle/download.html
(the trial version) or from Registered Users' Area (for users with active subscription only):
http://secure.devart.com/

For the detailed information about the fixes and improvements available in the latest build, please refer to
http://www.devart.com/forums/viewtopic.php?t=20708
StanislavK
Devart Team
 
Posts: 1710
Joined: Thu 03 Dec 2009 10:48

Postby crazypit » Fri 08 Apr 2011 06:26

I guess the changes are also applied in the latest LinqConnect version?
crazypit
 
Posts: 163
Joined: Wed 15 Apr 2009 08:43

Postby StanislavK » Fri 08 Apr 2011 14:22

Yes, these changes are available in LinqConnect 2.20.19 as well. We usually release LinqConnect and data providers simultaneously, thus fixes implemented in one product are available in others as well (provided that these other products include the related functionality).
StanislavK
Devart Team
 
Posts: 1710
Joined: Thu 03 Dec 2009 10:48

Postby crazypit » Tue 12 Apr 2011 12:16

Using the latest 2.20.19 version of LinqConnect, i got the following unhandled exception:

Application: Exis.eXray.AppServerService.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.AccessViolationException
Stack:
at Devart.Data.Oracle.OracleDataReader.Close()
at Devart.Data.Linq.Provider.ObjectReader`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].Dispose()
at Devart.Data.Linq.Provider.ObjectReader`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].MoveNext()
at System.Collections.Generic.List`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]..ctor(System.Collections.Generic.IEnumerable`1)
at System.Linq.Enumerable.ToList[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]](System.Collections.Generic.IEnumerable`1)
at Exis.eXray.WorkflowEngine.WorkflowService.ExecuteEventAction(Exis.eXray.Domain.Event, Exis.eXray.Domain.Case, Exis.eXray.Domain.EventTypeAction)
at Exis.eXray.WorkflowEngine.WorkflowService.ExecuteOpenCloseActions(Exis.eXray.Domain.Event, Exis.eXray.Domain.Case)

At least, is there a way for these exceptions to somehow get forwarded to application's main thread so that i can catch them? For me, it is not really a problem if i can handle them. Unless of course something gets really corrupted and should get fixed.
crazypit
 
Posts: 163
Joined: Wed 15 Apr 2009 08:43

Postby StanislavK » Wed 13 Apr 2011 14:20

Could you please describe the scenario performed in the ExecuteEventAction() method?

As far as I can understand from the stack trace, this particular thread is controlled by your service, and thus it should be possible to catch this exception and pass it to the main thread of the application.
StanislavK
Devart Team
 
Posts: 1710
Joined: Thu 03 Dec 2009 10:48

Postby crazypit » Wed 13 Apr 2011 14:37

A single ToList() compiled query is performed:

List parameterMappings = ParameterMapping.WorkflowService_ExecuteEventAction(dataContext, eventTypeAction.Id).ToList();

public static Func>
WorkflowService_ExecuteEventAction =
CompiledQuery.Compile(
(ExrayDataContext dataContext, long EventTypeActionId) =>
from parameterMapping in dataContext.ParameterMappings
from functionParameter in dataContext.FunctionParameters
where parameterMapping.FpId == functionParameter.Id
&& parameterMapping.EtaId == EventTypeActionId
orderby functionParameter.Type_Str
orderby functionParameter.Sort
select parameterMapping);

It is 100% SURE, that a possible exception bubbles up and handled by my application. This code is called maybe 50 times/sec and exceptions are caught and logged all the time.
crazypit
 
Posts: 163
Joined: Wed 15 Apr 2009 08:43

Next

Return to LinqConnect (LINQ to SQL support)