Hi,
I am getting the below error when running the Function.
Written a Function for loading the BAQ and then update the ABC Code for all the rows in the BAQ using BO objects.
BAQ returns 80000 records. Error occurs after 1100 records
Error details:
Ice.Common.BusinessObjectException: Program Ice.Services.Lib.RunTask when executing task 14691534 raised an unexpected exception with the following message: RunTask:
System.Data.Entity.Core.EntityException: The underlying provider failed on Open.
---> System.InvalidOperationException: Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached.
at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)
at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)
at System.Data.SqlClient.SqlConnection.Open()
at Epicor.Data.Provider.EpiConnection.Open() in C:\_releases\ICE\ICE4.2.200.0\Source\Server\Framework\Epicor.System\Data\EpiProvider2\EpiConnection.cs:line 241
at System.Data.Entity.Infrastructure.Interception.InternalDispatcher`1.Dispatch[TTarget,TInterceptionContext](TTarget target, Action`2 operation, TInterceptionContext interceptionContext, Action`3 executing, Action`3 executed)
at System.Data.Entity.Infrastructure.Interception.DbConnectionDispatcher.Open(DbConnection connection, DbInterceptionContext interceptionContext)
at System.Data.Entity.Core.EntityClient.EntityConnection.Open()
--- End of inner exception stack trace ---
at System.Data.Entity.Core.EntityClient.EntityConnection.Open()
at Ice.Services.ContextFactory.CreateContext() in C:\_releases\ICE\ICE4.2.200.0\Source\Server\Framework\Epicor.System\Services\ContextFactory.cs:line 70
at Ice.Services.ContextFactory.CreateContext[TDataContext]() in C:\_releases\ICE\ICE4.2.200.0\Source\Server\Framework\Epicor.System\Services\ContextFactory.cs:line 39
at Ice.Core.WriteTaskLog.WriteToTaskLog(String newMessage, Int64 taskNum, Boolean isError) in C:\_releases\ICE\ICE4.2.200.11\Source\Server\Internal\Lib\TaskLib\TaskBase\WriteTaskLog\WriteTaskLog.cs:line 39
at Ice.Internal.Task.ScheduledFunction.ExecuteFunction.RunProcess(Int64 instanceTaskNum, String outputFileName) in C:\_releases\ICE\ICE4.2.200.0\Source\Server\Internal\Task\ScheduledFunction\ExecuteFunction.cs:line 74
at Ice.Hosting.TaskCaller.InnerExecuteTask(IceDataContext newContext) in C:\_releases\ICE\ICE4.2.200.11\Source\Server\Framework\Epicor.Ice\Hosting\TaskCaller\TaskCaller.cs:line 68
at Ice.Hosting.TaskCaller.ExecuteTask() in C:\_releases\ICE\ICE4.2.200.11\Source\Server\Framework\Epicor.Ice\Hosting\TaskCaller\TaskCaller.cs:line 64
at Ice.Lib.RunTask.BpmFriendlyTaskLauncher.Run(String sessionIdPrefix, IceContext db, Action taskRunner) in C:\_releases\ICE\ICE4.2.200.0\Source\Server\Services\Lib\RunTask\BpmFriendlyTaskLauncher.cs:line 63
at Ice.Services.Lib.RunTaskSvc.InnerRunTask(Int64 ipTaskNum, Boolean suppressTransaction) in C:\_releases\ICE\ICE4.2.200.0\Source\Server\Services\Lib\RunTask\RunTask.cs:line 450
Program Ice.Services.Lib.RunTask when executing task 14691534 raised an unexpected exception with the following message: RunTask:
System.Data.Entity.Core.EntityException: The underlying provider failed on Open.
---> System.InvalidOperationException: Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached.
at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)
at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)
at System.Data.SqlClient.SqlConnection.Open()
at Epicor.Data.Provider.EpiConnection.Open() in C:\_releases\ICE\ICE4.2.200.0\Source\Server\Framework\Epicor.System\Data\EpiProvider2\EpiConnection.cs:line 241
at System.Data.Entity.Infrastructure.Interception.InternalDispatcher`1.Dispatch[TTarget,TInterceptionContext](TTarget target, Action`2 operation, TInterceptionContext interceptionContext, Action`3 executing, Action`3 executed)
at System.Data.Entity.Infrastructure.Interception.DbConnectionDispatcher.Open(DbConnection connection, DbInterceptionContext interceptionContext)
at System.Data.Entity.Core.EntityClient.EntityConnection.Open()
--- End of inner exception stack trace ---
at System.Data.Entity.Core.EntityClient.EntityConnection.Open()
at Ice.Services.ContextFactory.CreateContext() in C:\_releases\ICE\ICE4.2.200.0\Source\Server\Framework\Epicor.System\Services\ContextFactory.cs:line 70
at Ice.Services.ContextFactory.CreateContext[TDataContext]() in C:\_releases\ICE\ICE4.2.200.0\Source\Server\Framework\Epicor.System\Services\ContextFactory.cs:line 39
at Ice.Core.WriteTaskLog.WriteToTaskLog(String newMessage, Int64 taskNum, Boolean isError) in C:\_releases\ICE\ICE4.2.200.11\Source\Server\Internal\Lib\TaskLib\TaskBase\WriteTaskLog\WriteTaskLog.cs:line 39
at Ice.Services.Lib.RunTaskSvc.SetTaskStatusForError(SysTask sysTask, Int64 taskNumber) in C:\_releases\ICE\ICE4.2.200.0\Source\Server\Services\Lib\RunTask\RunTask.cs:line 1178
at Ice.Services.Lib.RunTaskSvc.SetTaskStatus(String status, Int64 taskNumber, Boolean clearActivityMessage, Boolean isAPRTask) in C:\_releases\ICE\ICE4.2.200.0\Source\Server\Services\Lib\RunTask\RunTask.cs:line 908
at Ice.Cloud.ProxyBase`1.CallWithCommunicationFailureRetry(String methodName, ProxyValuesIn valuesIn, ProxyValuesOut valuesOut, RestRpcValueSerializer serializer) in C:\_releases\ICE\ICE4.2.200.5\Source\Shared\Framework\Epicor.ServiceModel\Cloud\ProxyBase.cs:line 725
at Ice.Cloud.ProxyBase`1.CallWithMultistepBpmHandling(String methodName, ProxyValuesIn valuesIn, ProxyValuesOut valuesOut, Boolean useSparseCopy) in C:\_releases\ICE\ICE4.2.200.5\Source\Shared\Framework\Epicor.ServiceModel\Cloud\ProxyBase.cs:line 670
at Ice.Cloud.ProxyBase`1.Call(String methodName, ProxyValuesIn valuesIn, ProxyValuesOut valuesOut, Boolean useSparseCopy) in C:\_releases\ICE\ICE4.2.200.5\Source\Shared\Framework\Epicor.ServiceModel\Cloud\ProxyBase.cs:line 649
at Ice.Proxy.Lib.RunTaskImpl.RunTask(Int64 ipTaskNum) in C:\_releases\ICE\ICE4.2.200.0\Source\Shared\Contracts\Lib\RunTask\RunTaskProxy.cs:line 63
at Ice.TaskAgentCore.ImplCaller.RunTaskImplCaller`1.<>c__DisplayClass4_0.<Call>b__0(TImpl impl) in C:\_releases\ICE\ICE4.2.200.5\Source\TaskAgent\TaskAgentCore\ImplCaller\RunTaskImplCaller.cs:line 47
at Ice.TaskAgentCore.ImplCaller.RunTaskImplCaller`1.Call[TResult](Func`2 doWork, ExceptionBehavior communicationExceptionBehavior, ExceptionBehavior timeoutExceptionBehavior, Boolean isContinuousProcessingTask) in C:\_releases\ICE\ICE4.2.200.5\Source\TaskAgent\TaskAgentCore\ImplCaller\RunTaskImplCaller.cs:line 150
at Ice.TaskAgentCore.ImplCaller.RunTaskImplCaller`1.Call(Action`1 doWork, ExceptionBehavior communicationExceptionBehavior, ExceptionBehavior timeoutExceptionBehavior, Boolean isContinuousProcessingTask) in C:\_releases\ICE\ICE4.2.200.5\Source\TaskAgent\TaskAgentCore\ImplCaller\RunTaskImplCaller.cs:line 52
at Ice.TaskAgentCore.ScheduleProcessor.CallServiceAction(SysTaskRow sysTaskRecord, SysTaskParamRow companyParamRecord, ServiceCallArguments serviceCallArguments, Boolean isContinuousStartupTask) in C:\_releases\ICE\ICE4.2.200.5\Source\TaskAgent\TaskAgentCore\ScheduleProcessor.cs:line 948