Estoy en la version 1.10.0.9 en donde estoy tratando de autorizar vacaciones pero algunos flujos me han lanzado dos tipos de errores diferentes:

El primero es este:

Aseinfo.Infrastructure.Base.Exceptions.AuthorizationWorkflowException: Sucedio un error en el flujo. Se está logueando el exception interno y luego se logueará el que terminará la instancia ---> System.Data.Entity.Core.UpdateException: An error occurred while updating the entries. See the inner exception for details. ---> System.Data.SqlClient.SqlException: Transaction (Process ID 114) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()
at System.Data.SqlClient.SqlDataReader.get_MetaData()
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, SqlDataReader ds)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite)
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.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
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.Mapping.Update.Internal.DynamicUpdateCommand.Execute(Dictionary`2 identifierValues, List`1 generatedValues)
at System.Data.Entity.Core.Mapping.Update.Internal.UpdateTranslator.Update()
--- End of inner exception stack trace ---
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.SqlServer.DefaultSqlExecutionStrategy.Execute[TResult](Func`1 operation)
at System.Data.Entity.Core.Objects.ObjectContext.SaveChangesInternal(SaveOptions options, Boolean executeInExistingTransaction)
at Aseinfo.VH4.Data.AppDataContext.SaveChanges(SaveOptions options) in C:\vh4\VH4\Data\AppDataContext.cs:line 98
at Aseinfo.Infrastructure.Base.Entity.EntityServiceBase`2.SaveChanges() in C:\vh4\Infrastructure\Base\Entity\EntityServiceBase.cs:line 568
at Aseinfo.Infrastructure.Base.Entity.EntityServiceBase`2.DoUpdate(T entity, Boolean saveChanges) in C:\vh4\Infrastructure\Base\Entity\EntityServiceBase.cs:line 983
at Aseinfo.VH4.WorkflowServices.Services.AuthorizationWorkflowService.EscalarActividad(Int32 codigoActividad) in C:\VH4\VH4\WorkflowServices\WorkflowServices\Services\AuthorizationWorkflowService.cs:line 491
at Aseinfo.VH4.WorkflowServices.Services.AuthorizationWorkflowStaticService.EscalarActividad(Int32 codigoActividad, WorkflowContext context) in C:\VH4\VH4\WorkflowServices\WorkflowServices\Services\AuthorizationWorkflowStaticService.cs:line 160
--- End of inner exception stack trace ---
at System.Activities.Statements.MethodExecutor.InvokeAndUnwrapExceptions(Func`3 func, Object targetInstance, Object[] actualParameters)
at System.Activities.Statements.MethodResolver.SyncMethodExecutor.BeginMakeMethodCall(AsyncCodeActivityContext context, Object target, AsyncCallback callback, Object state)
at System.Activities.Statements.MethodExecutor.BeginExecuteMethod(AsyncCodeActivityContext context, AsyncCallback callback, Object state)
at System.Activities.AsyncCodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)
at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)

El segundo error que da es:

Aseinfo.Infrastructure.Base.Exceptions.AuthorizationWorkflowException: Sucedio un error en el flujo. Se está logueando el exception interno y luego se logueará el que terminará la instancia ---> System.InvalidOperationException: The connection is not open.
at System.Data.Entity.Core.EntityClient.EntityConnection.Open()
at System.Data.Entity.Core.Objects.ObjectContext.EnsureConnection(Boolean shouldMonitorTransactions)
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.ObjectQuery`1.<System.Collections.Generic.IEnumerable<T>.GetEnumerator>b__0()
at System.Data.Entity.Internal.LazyEnumerator`1.MoveNext()
at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source)
at System.Data.Entity.Core.Objects.CompiledQuery.ExecuteQuery[TResult](ObjectContext context, Object[] parameterValues)
at System.Data.Entity.Core.Objects.CompiledQuery.Invoke[TArg0,TArg1,TArg2,TResult](TArg0 arg0, TArg1 arg1, TArg2 arg2)
at Aseinfo.Infrastructure.Common.Data.LocalizationDatabaseRepositoryBase.DatabaseSearch(ConfigDataContext configDataContext, CultureInfo culture, String area, String key) in C:\vh4\Infrastructure\Common\Localization\LocalizationDatabaseRepositoryBase.cs:line 64
at Aseinfo.Infrastructure.Common.Data.LocalizationCachedDatabaseRepository.Search(String key, String area, CultureInfo culture) in C:\vh4\Infrastructure\Common\Localization\LocalizationCachedDatabaseRepository.cs:line 69
at Aseinfo.Infrastructure.Common.LocalizationService.GetLocalized(String key, String area, Stack`1 localizedKeysStack, CultureInfo culture) in C:\vh4\Infrastructure\Common\Localization\LocalizationService.cs:line 416
at Aseinfo.Infrastructure.Common.LocalizationService.GetLocalized(String key, String area, CultureInfo culture) in C:\vh4\Infrastructure\Common\Localization\LocalizationService.cs:line 214
at Aseinfo.VH4.WorkflowServices.Services.AuthorizationWorkflowService.GeneraMensajeNotificacion(InstanciaRutaAutorizacion instancia, ActividadAutorizacionInstancia actividad, Empleo responsable, String mensaje, Exception exception, Empleo empleoSustituido) in C:\VH4\VH4\WorkflowServices\WorkflowServices\Services\AuthorizationWorkflowService.cs:line 1225
at Aseinfo.VH4.WorkflowServices.Services.AuthorizationWorkflowService.GeneraMensajeNotificacion(ActividadAutorizacionInstancia actividad, Empleo responsable, String mensaje, Empleo empleoSustituido) in C:\VH4\VH4\WorkflowServices\WorkflowServices\Services\AuthorizationWorkflowService.cs:line 1189
at Aseinfo.VH4.WorkflowServices.Services.AuthorizationWorkflowService.EnviarRecordatorioActividad(Int32 codigoActividad) in C:\VH4\VH4\WorkflowServices\WorkflowServices\Services\AuthorizationWorkflowService.cs:line 556
at Aseinfo.VH4.WorkflowServices.Services.AuthorizationWorkflowStaticService.EnviarRecordatorioActividad(Int32 codigoActividad, WorkflowContext context) in C:\VH4\VH4\WorkflowServices\WorkflowServices\Services\AuthorizationWorkflowStaticService.cs:line 138
--- End of inner exception stack trace ---
at System.Activities.Statements.MethodExecutor.InvokeAndUnwrapExceptions(Func`3 func, Object targetInstance, Object[] actualParameters)
at System.Activities.Statements.MethodResolver.SyncMethodExecutor.BeginMakeMethodCall(AsyncCodeActivityContext context, Object target, AsyncCallback callback, Object state)
at System.Activities.Statements.MethodExecutor.BeginExecuteMethod(AsyncCodeActivityContext context, AsyncCallback callback, Object state)
at System.Activities.AsyncCodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)
at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)

Cabe decir que no sucede siempre, es rara vez que sucede. Los flujos tienen 3 actividades y este error por lo general da cuando la segunda actividad autoriza.

asked 14 Sep '17, 08:15

Josue%20Mancilla's gravatar image

Josue Mancilla
(suspended)
accept rate: 42%


Es un deadlock a nivel de base.

Tendrías que monitorear que proceso es el que se está ejecutando en el momento que se intenta autorizar. Porque el error lo reporta en la transacción que cierra, por causa de que otro proceso tiene bloqueados los registros que esta transacción quiere modificar. El problema complejo en estos casos es que el error no te da información sobre el otro proceso.

La solución va encaminada a encontrar cual es el proceso que bloquea la autorización.

Te dejo algunos links que hablan sobre como detectar procesos que generan deadlocks.

Very quick guide deadlock

Detecting and Ending Deadlocks

link

answered 14 Sep '17, 18:53

Fernando%20Paz's gravatar image

Fernando Paz ♦♦
17.3k81635
accept rate: 51%

Fernando, fijate que ese mismo error me dio nuevamente con el cliente, solamente que ahora en la version 1.11.0.2. Lo curioso es que solo pasa con un usuario no con todos.

(30 Nov '17, 08:07) Josue Mancilla Josue%20Mancilla's gravatar image
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
×14

Asked: 14 Sep '17, 08:15

Seen: 1,086 times

Last updated: 30 Nov '17, 08:07

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