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.