The provider did not create a CommandDefinition

The provider did not create a CommandDefinition

Postby skoub » Wed 09 Sep 2015 17:58

i have an intermittent problem. I get this error message in my application for no particular reason because when i call a refresh to this page, the problem disappear. The application can run for a few hours without problem and then decide to throw an exception. So i cannot give you a test projet for that particular reason.

I'm running my app with MVC5, Framework 4.5.2 and Devart v8.5.478.0 (also tried with v8.4.359.0).

Code: Select all
System.Data.Entity.Core.ProviderIncompatibleException: The provider did not create a CommandDefinition. ---> System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
   at System.Collections.Generic.List`1.get_Item(Int32 index)
   at Devart.Common.Entity.ag.a(br A_0, br A_1)
   at Devart.Common.Entity.ep.a(ah A_0, DbCommand A_1)
   at Devart.Common.Entity.e6.a(ah A_0, DbCommandBase A_1)
   at Devart.Common.Entity.e6.c()
   at Devart.Data.Oracle.Entity.OracleEntityProviderServices.CreateDbCommandDefinition(DbProviderManifest baseProviderManifest, DbCommandTree commandTree)
   at System.Data.Entity.Core.Common.DbProviderServices.CreateCommandDefinition(DbProviderManifest providerManifest, DbCommandTree commandTree)
   --- End of inner exception stack trace ---
   at System.Data.Entity.Core.Common.DbProviderServices.CreateCommandDefinition(DbProviderManifest providerManifest, DbCommandTree commandTree)
   at StackExchange.Profiling.Data.EFProfiledDbProviderServices`1.CreateDbCommandDefinition(DbProviderManifest providerManifest, DbCommandTree commandTree)
   at System.Data.Entity.Core.Common.DbProviderServices.CreateCommand(DbCommandTree commandTree, DbInterceptionContext interceptionContext)
   at System.Data.Entity.Core.Mapping.Update.Internal.UpdateTranslator.CreateCommand(DbModificationCommandTree commandTree)
   at System.Data.Entity.Core.Mapping.Update.Internal.DynamicUpdateCommand.CreateCommand(Dictionary`2 identifierValues)
   at System.Data.Entity.Core.Mapping.Update.Internal.DynamicUpdateCommand.Execute(Dictionary`2 identifierValues, List`1 generatedValues)
   at System.Data.Entity.Core.Mapping.Update.Internal.UpdateTranslator.Update()
   at System.Data.Entity.Core.Objects.ObjectContext.ExecuteInTransaction[T](Func`1 func, IDbExecutionStrategy executionStrategy, Boolean startLocalTransaction, Boolean releaseConnectionOnSuccess)
   at System.Data.Entity.Core.Objects.ObjectContext.SaveChangesToStore(SaveOptions options, IDbExecutionStrategy executionStrategy, Boolean startLocalTransaction)
   at System.Data.Entity.Core.Objects.ObjectContext.SaveChangesInternal(SaveOptions options, Boolean executeInExistingTransaction)
   at System.Data.Entity.Internal.InternalContext.SaveChanges()
   at MTO.Sysgot.Web.Controllers.Pilotage.TypesOffresTouristiques.TypesOffresTouristiquesController.Add(Boolean isRepertoire, Nullable`1 typeOffreTouristiqueParentId, TypeOffreFormViewModel typeOffreFormViewModel)
   at lambda_method(Closure , ControllerBase , Object[] )
   at System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters)
   at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters)
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.<BeginInvokeSynchronousActionMethod>b__39(IAsyncResult asyncResult, ActionInvocation innerInvokeState)
   at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult`2.CallEndDelegate(IAsyncResult asyncResult)
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3d()
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f()
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f()
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass33.<BeginInvokeActionMethodWithFilters>b__32(IAsyncResult asyncResult)
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass21.<>c__DisplayClass2b.<BeginInvokeAction>b__1c()
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass21.<BeginInvokeAction>b__1e(IAsyncResult asyncResult)
   at System.Web.Mvc.Controller.<BeginExecuteCore>b__1d(IAsyncResult asyncResult, ExecuteCoreState innerState)
   at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult)
   at System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult)
   at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult)
   at System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__5(IAsyncResult asyncResult, ProcessRequestState innerState)
   at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult)
   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
skoub
 
Posts: 32
Joined: Fri 21 May 2010 15:47

Re: The provider did not create a CommandDefinition

Postby Shalex » Fri 11 Sep 2015 09:02

1. Turn on the dbMonitor tool. Is there any failed SQL statement in dbMonitor when the application throws the ArgumentOutOfRangeException?
2. Please try to localize the issue and send us a small test project with the corresponding DDL/DML script for reproducing.
Shalex
Devart Team
 
Posts: 7465
Joined: Thu 14 Aug 2008 12:44

Re: The provider did not create a CommandDefinition

Postby skoub » Mon 14 Sep 2015 13:07

Its difficult to trap the error because it's intermittent but i can confirm that the sql statement is not sent to the database (dbMonitor).
skoub
 
Posts: 32
Joined: Fri 21 May 2010 15:47

Re: The provider did not create a CommandDefinition

Postby Shalex » Tue 15 Sep 2015 14:32

Code: Select all
...
   at MTO.Sysgot.Web.Controllers.Pilotage.TypesOffresTouristiques.TypesOffresTouristiquesController.Add(Boolean isRepertoire, Nullable`1 typeOffreTouristiqueParentId, TypeOffreFormViewModel typeOffreFormViewModel)
...

Looks like your code creates and adds new object/objects, saves them in DbContext/ObjectContext using SaveChanges(). I.e. you can extract all EF model files (code of model, classes, xml files if any) and connection string from your huge project. Then add these files to a separate newly created test application, implement a multithreading where each thread will add/save exactly the same object/objects which cause the fail.

This should be enough for reproducing. If so, please send us your test application with the corresponding DDL script for reproducing.
Shalex
Devart Team
 
Posts: 7465
Joined: Thu 14 Aug 2008 12:44


Return to dotConnect for Oracle