Cuando el número de flujo de autorizaciones pendientes es alto, en este caso 102, el sistema muestra el siguiente mensaje de error:

System.Data.Entity.Core.EntityCommandExecutionException: An error occurred while executing the command definition. See the inner exception for details. ---> System.InvalidOperationException: There is already an open DataReader associated with this Command which must be closed first. at System.Data.SqlClient.SqlInternalConnectionTds.ValidateConnectionForExecute(SqlCommand command) at System.Data.SqlClient.SqlCommand.ValidateCommand(String method, Boolean async) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) at System.Data.Entity.Infrastructure.Interception.InternalDispatcher`1.Dispatch[TTarget,TInterceptionContext,TResult](TTarget target, Func`3 operation, TInterceptionContext interceptionContext, Action`3 executing, Action`3 executed) at System.Data.Entity.Infrastructure.Interception.DbCommandDispatcher.Reader(DbCommand command, DbCommandInterceptionContext interceptionContext) at System.Data.Entity.Core.EntityClient.Internal.EntityCommandDefinition.ExecuteStoreCommands(EntityCommand entityCommand, CommandBehavior behavior) --- End of inner exception stack trace --- at System.Data.Entity.Core.EntityClient.Internal.EntityCommandDefinition.ExecuteStoreCommands(EntityCommand entityCommand, CommandBehavior behavior) at System.Data.Entity.Core.Objects.Internal.ObjectQueryExecutionPlan.Execute[TResultType](ObjectContext context, ObjectParameterCollection parameterValues) at System.Data.Entity.Core.Objects.ObjectContext.ExecuteInTransaction[T](Func`1 func, IDbExecutionStrategy executionStrategy, Boolean startLocalTransaction, Boolean releaseConnectionOnSuccess) at System.Data.Entity.Core.Objects.ObjectQuery`1.<>c__DisplayClass7.<GetResults>b__5() at System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy.Execute[TResult](Func`1 operation) at System.Data.Entity.Core.Objects.ObjectQuery`1.GetResults(Nullable`1 forMergeOption) at System.Data.Entity.Core.Objects.DataClasses.EntityReference`1.Load(MergeOption mergeOption) at System.Data.Entity.Core.Objects.DataClasses.RelatedEnd.DeferredLoad() at System.Data.Entity.Core.Objects.DataClasses.EntityReference`1.get_Value() at Aseinfo.VH4.Infraestructura.Services.ActividadAutorizacionInstanciaService.<>c__DisplayClass11_0.<GetActividadesGestionadasUsuarioAutenticado>b__7(ActividadAutorizacionInstancia a) in C:h4VH4InfraestructuraServicesActividadesAutorizacionInstanciaActividadAutorizacionInstanciaService.cs:line 402 at System.Linq.Enumerable.<>c__DisplayClass6_0`1.<CombinePredicates>b__0(TSource x) at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext() at System.Linq.Enumerable.Count[TSource](IEnumerable`1 source) at Aseinfo.VH4.Infraestructura.Services.ActividadAutorizacionInstanciaService.GetActividadesGestionadasUsuarioAutenticado(Int32 pageNumber, Int32 resultsPerPage, String sorting, String filtro, String tipoRegistro, EstadoActividadInstancia estadoActividad, Nullable`1 estadoInstancia, String codtip, Nullable`1 codcia, String codsujacc, String codsujsol, String fechaNotificacion, Int32& totalAutorizaciones, Expression`1[] includes) in C:h4VH4InfraestructuraServicesActividadesAutorizacionInstanciaActividadAutorizacionInstanciaService.cs:line 420 at Aseinfo.VH4.General.Controllers.FlujosAutorizacionController.GetFlujosAutorizacion(GridCommand command, String filtro, String codtip, Nullable`1 codcia, String codsujacc, String codsujsol, String fechaNotificacion) in C:h4VH4GeneralControllersFlujosAutorizacionController.cs:line 449 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.EndInvokeActionMethod(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.AsyncInvocationWithFilters.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() 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.AsyncInvocationWithFilters.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(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)

alt text

alt text

alt text

asked 08 Aug '19, 17:55

ghuerta's gravatar image

ghuerta
(suspended)
accept rate: 100%

edited 09 Aug '19, 08:19

sbarahona's gravatar image

sbarahona ♦♦
(suspended)


Yo me he topado con este inconveniente y usualmente es porque existen algunas pendientes con inconvenientes en base de datos que hace que la consulta sea lenta, y en otras me he topado que el log de EvoTemp ya es muy grande y le toma mucho tiempo paginar (Para esto haces un shrink al log) recordemos que el log de EvoTemp puede tener hasta 0MB en su minimo.

link

answered 09 Aug '19, 07:48

MiguelBustamante's gravatar image

MiguelBustamante
52158108116
accept rate: 31%

Fijate que se hizo pero no funciono.

(27 Aug '19, 08:50) ghuerta ghuerta's gravatar image

En base al profiler del propio Evolution a continuacion pongo el query que se ejecuta para enlistar las autorizaciones pendientes. Revisalo y tal vez se pueda optimizar la base con un indice o algun otro tipo de solucion

SELECT 
    [Project3].[ain_codigo] AS [ain_codigo], 
    [Project3].[ain_nombre] AS [ain_nombre], 
    [Project3].[ain_tipo_autorizador] AS [ain_tipo_autorizador], 
    [Project3].[ain_num_record_escalar] AS [ain_num_record_escalar], 
    [Project3].[ain_minutos_recordatorio] AS [ain_minutos_recordatorio], 
    [Project3].[ain_estado] AS [ain_estado], 
    [Project3].[ain_usuario_procesa] AS [ain_usuario_procesa], 
    [Project3].[ain_fecha_procesa] AS [ain_fecha_procesa], 
    [Project3].[ain_orden] AS [ain_orden], 
    [Project3].[ain_usuario_grabacion] AS [ain_usuario_grabacion], 
    [Project3].[ain_fecha_grabacion] AS [ain_fecha_grabacion], 
    [Project3].[ain_usuario_modificacion] AS [ain_usuario_modificacion], 
    [Project3].[ain_fecha_modificacion] AS [ain_fecha_modificacion], 
    [Project3].[ain_fecha_pendiente] AS [ain_fecha_pendiente], 
    [Project3].[ain_fecha_notificado] AS [ain_fecha_notificado], 
    [Project3].[ain_fecha_autorizado] AS [ain_fecha_autorizado], 
    [Project3].[ain_fecha_denegado] AS [ain_fecha_denegado], 
    [Project3].[ain_fecha_anulado] AS [ain_fecha_anulado], 
    [Project3].[ain_comentarios] AS [ain_comentarios], 
    [Project3].[ain_actividad_revision] AS [ain_actividad_revision], 
    [Project3].[ain_chequea_aut_act_ant] AS [ain_chequea_aut_act_ant], 
    [Project3].[ain_acepta_aut_sustitutos] AS [ain_acepta_aut_sustitutos], 
    [Project3].[ain_codemp_procesa] AS [ain_codemp_procesa], 
    [Project3].[ain_coddar] AS [ain_coddar], 
    [Project3].[ain_codira] AS [ain_codira], 
    [Project3].[ain_codain_destino_denegar] AS [ain_codain_destino_denegar], 
    [Project3].[ain_codain_reintenta] AS [ain_codain_reintenta], 
    [Project3].[ain_es_requerida] AS [ain_es_requerida], 
    [Project3].[ain_ignora_vacantes_jerarquia] AS [ain_ignora_vacantes_jerarquia], 
    [Project3].[ain_permitir_aut_suj_acc] AS [ain_permitir_aut_suj_acc]
    FROM ( SELECT 
        [Extent1].[ain_codigo] AS [ain_codigo], 
        [Extent1].[ain_codira] AS [ain_codira], 
        [Extent1].[ain_coddar] AS [ain_coddar], 
        [Extent1].[ain_codain_destino_denegar] AS [ain_codain_destino_denegar], 
        [Extent1].[ain_codain_reintenta] AS [ain_codain_reintenta], 
        [Extent1].[ain_nombre] AS [ain_nombre], 
        [Extent1].[ain_tipo_autorizador] AS [ain_tipo_autorizador], 
        [Extent1].[ain_num_record_escalar] AS [ain_num_record_escalar], 
        [Extent1].[ain_minutos_recordatorio] AS [ain_minutos_recordatorio], 
        [Extent1].[ain_estado] AS [ain_estado], 
        [Extent1].[ain_usuario_procesa] AS [ain_usuario_procesa], 
        [Extent1].[ain_fecha_procesa] AS [ain_fecha_procesa], 
        [Extent1].[ain_codemp_procesa] AS [ain_codemp_procesa], 
        [Extent1].[ain_orden] AS [ain_orden], 
        [Extent1].[ain_fecha_pendiente] AS [ain_fecha_pendiente], 
        [Extent1].[ain_fecha_notificado] AS [ain_fecha_notificado], 
        [Extent1].[ain_fecha_autorizado] AS [ain_fecha_autorizado], 
        [Extent1].[ain_fecha_denegado] AS [ain_fecha_denegado], 
        [Extent1].[ain_fecha_anulado] AS [ain_fecha_anulado], 
        [Extent1].[ain_comentarios] AS [ain_comentarios], 
        [Extent1].[ain_actividad_revision] AS [ain_actividad_revision], 
        [Extent1].[ain_chequea_aut_act_ant] AS [ain_chequea_aut_act_ant], 
        [Extent1].[ain_acepta_aut_sustitutos] AS [ain_acepta_aut_sustitutos], 
        [Extent1].[ain_es_requerida] AS [ain_es_requerida], 
        [Extent1].[ain_ignora_vacantes_jerarquia] AS [ain_ignora_vacantes_jerarquia], 
        [Extent1].[ain_permitir_aut_suj_acc] AS [ain_permitir_aut_suj_acc], 
        [Extent1].[ain_usuario_grabacion] AS [ain_usuario_grabacion], 
        [Extent1].[ain_fecha_grabacion] AS [ain_fecha_grabacion], 
        [Extent1].[ain_usuario_modificacion] AS [ain_usuario_modificacion], 
        [Extent1].[ain_fecha_modificacion] AS [ain_fecha_modificacion]
        FROM [wfl].[ain_actividades_instancia] AS [Extent1]
        WHERE (( EXISTS (SELECT 
            1 AS [C1]
            FROM  [wfl].[dra_det_responsables_act_inst] AS [Extent2]
            INNER JOIN [exp].[emp_empleos] AS [Extent3] ON [Extent2].[dra_codemp] = [Extent3].[emp_codigo]
            WHERE ([Extent1].[ain_codigo] = [Extent2].[dra_codain]) AND ([Extent3].[emp_codexp] = xxx)
        )) OR (([Extent1].[ain_acepta_aut_sustitutos] = 1) AND ( EXISTS (SELECT 
            1 AS [C1]
            FROM   (SELECT [Extent4].[dra_codain] AS [dra_codain], [Extent5].[esu_codemp_sustituto] AS [esu_codemp_sustituto]
                FROM  [wfl].[dra_det_responsables_act_inst] AS [Extent4]
                INNER JOIN [wfl].[esu_empleos_sustitutos] AS [Extent5] ON [Extent4].[dra_codemp] = [Extent5].[esu_codemp_titular]
                WHERE ([Extent5].[esu_fecha_inicio] <= convert(datetime2, '2019-08-12 00:00:00.0000000', 121)) AND ([Extent5].[esu_fecha_fin] >= convert(datetime2, '2019-08-12 00:00:00.0000000', 121)) ) AS [Filter2]
            INNER JOIN [exp].[emp_empleos] AS [Extent6] ON [Filter2].[esu_codemp_sustituto] = [Extent6].[emp_codigo]
            WHERE ([Extent1].[ain_codigo] = [Filter2].[dra_codain]) AND ([Extent6].[emp_codexp] = xxx)
        )))) AND ([Extent1].[ain_estado] = 'Notificado')
    )  AS [Project3]
    ORDER BY [Project3].[ain_fecha_notificado] DESC
link

answered 12 Aug '19, 10:24

sbarahona's gravatar image

sbarahona ♦♦
(suspended)
accept rate: 32%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Evolution en BitBucket

En este sitio puede acceder al código fuente, centro de descargas y reportar bugs, propuestas y mejoras para Evolution.

Evolution en JIRA

En este sitio puedes sugerir nueva funcionalidad para Evolution, o puedes votar por la funcionalidad ya propuesta por otros usuarios.

Tags:

×92
×83
×5

Asked: 08 Aug '19, 17:55

Seen: 631 times

Last updated: 27 Aug '19, 08:50

[Acerca de] [Preguntas Frecuentes] [Privacidad] [Soporte] [Contacto]
Copyright 2013-2018. Asesores en Informática