Time Out Issue

We have been having an ongoing battle with Balanced Base vs Transactional GL Allocations, and have a few batches currently that have to be run as Transactional and take a long time to run. We have one now that is crossing the 5 hour mark and is timing out. I have changed the .NET timeout to 10 hours from 5 hours, but this didn’t seem to help. Is there another setting to increase the timeout time? Here is the error:

Program Ice.Services.Lib.RunTask raised an unexpected exception with the following message: RunTask: An error occurred while executing the command definition. See the inner exception for details.
Stack Trace:
at System.Data.EntityClient.EntityCommandDefinition.ExecuteStoreCommands(EntityCommand entityCommand, CommandBehavior behavior)
at System.Data.Objects.Internal.ObjectQueryExecutionPlan.Execute[TResultType](ObjectContext context, ObjectParameterCollection parameterValues)
at System.Data.Objects.ObjectQuery1.GetResults(Nullable1 forMergeOption)
at System.Data.Objects.ObjectQuery1.System.Collections.Generic.IEnumerable<T>.GetEnumerator() at System.Linq.Enumerable.Single[TSource](IEnumerable1 source)
at System.Data.Objects.CompiledQuery.ExecuteQuery[TResult](ObjectContext context, Object[] parameterValues)
at Epicor.Data.DBExpressionCompiler.<>c__DisplayClass39_19.<Compile>b__3(TContext c, Func9 query) in C:_Releases\ICE\3.1.500.8\Source\Framework\Epicor.System\Data\DBExpressionCompiler.Generated.cs:line 1272
at Epicor.Data.DBExpressionCompiler.GetResult[TContext,TQuery,TResult](Func3 executeQuery, Cache cacheSetting, TContext dataContext, TQuery query) in C:\_Releases\ICE\3.1.500.8\Source\Framework\Epicor.System\Data\DBExpressionCompiler.cs:line 439 at Epicor.Data.DBExpressionCompiler.InvokeSingle[TContext,TQuery,TResult](Expression expression, Cache currentCacheSetting, Boolean cacheQuery, TContext dataContext, Func2 getDataCacheKey, Func2 compileQuery, Func3 executeQuery) in C:_Releases\ICE\3.1.500.8\Source\Framework\Epicor.System\Data\DBExpressionCompiler.cs:line 300
at Erp.Internal.GL.AllocateGL.AnyAlcHistResParams(String companyID, String batchID, String allocID, Int32 runNbr, Int32 allocTgtNbr, Int32 allocTgtSeq, Int32 paramNbr) in c:_Releases\ERP\RL10.1.500\Source\Server\Internal\GL\AllocateGL\AllocateGL.Queries.cs:line 450
at Erp.Internal.GL.AllocateGL.createAllocIDResolvedParams(Decimal ipActualValue, String ipGLAccount, String[] ipSegArray) in c:_Releases\ERP\RL10.1.500\Source\Server\Internal\GL\AllocateGL\AllocateGL.cs:line 1964
at Erp.Internal.GL.AllocateGL.applyFormula(String ipTargetGLAccount, String[] ipTargetSegArray, String[] ipSourceSegArray, Decimal& opFormulaResult, String& opResolvedFormula) in c:_Releases\ERP\RL10.1.500\Source\Server\Internal\GL\AllocateGL\AllocateGL.cs:line 845
at Erp.Internal.GL.AllocateGL.RvJrnBAlAllocation(Decimal ipBookCreditAmount, Decimal ipBookDebitAmount, Decimal ipCreditAmount, Decimal ipDebitAmount, String ipSourceAcct, String[] ipSourceSegArray, String ipJournalCode, Int32 ipJournalNum, Int32 ipJournalLine, String ipCurrCode) in c:_Releases\ERP\RL10.1.500\Source\Server\Internal\GL\AllocateGL\AllocateGL.cs:line 3004
at Erp.Internal.GL.AllocateGL.DataSelectedFromRvJrnTrDtl() in c:_Releases\ERP\RL10.1.500\Source\Server\Internal\GL\AllocateGL\AllocateGL.cs:line 2316
at Erp.Internal.GL.AllocateGL.AllocateGLJournals(Nullable1 ipApplyDate, String ipBatchList, String ipSchedDateList, String ipBookID, Boolean ipEditList, String ipFiscalCalendarID, Int32 ipFiscalPeriod, Int32 ipFiscalYear, String ipFiscalYearSuffix, Boolean ipSim, Nullable1 ipStartDate, Nullable1 ipEndDate, Boolean ipYTDAlloc, String& opInfoMessage) in c:\_Releases\ERP\RL10.1.500\Source\Server\Internal\GL\AllocateGL\AllocateGL.cs:line 625 at Erp.Internal.GL.RunGLAllocations.RunProcess(Int64 instanceTaskNum, String outputFileName) in c:\_Releases\ERP\RL10.1.500\Source\Server\Internal\GL\RunGLAllocations\RunGLAllocations.cs:line 72 at Ice.Hosting.TaskCaller.InnerExecuteTask(IceDataContext newContext) in C:\_Releases\ICE\3.1.500.8\Source\Framework\Epicor.Ice\Hosting\TaskCaller\TaskCaller.cs:line 93 at Ice.Hosting.TaskCaller.ExecuteTask() in C:\_Releases\ICE\3.1.500.8\Source\Framework\Epicor.Ice\Hosting\TaskCaller\TaskCaller.cs:line 54 at Ice.Lib.RunTask.BpmFriendlyTaskLauncher.Run(String sessionIdPrefix, IceContext db, Action taskRunner) in C:\_Releases\ICE\3.1.500.8\Source\Server\Services\Lib\RunTask\BpmFriendlyTaskLauncher.cs:line 63 at Ice.Services.Lib.RunTaskSvc.InnerRunTask(Int64 ipTaskNum, Boolean suppressTransaction) in C:\_Releases\ICE\3.1.500.8\Source\Server\Services\Lib\RunTask\RunTask.cs:line 526 Inner Exception: Invalid operation. The connection is closed. Stack Trace: at System.Data.SqlClient.TdsParser.TdsExecuteRPC(SqlCommand cmd, _SqlRPC[] rpcArray, Int32 timeout, Boolean inSchema, SqlNotificationRequest notificationRequest, TdsParserStateObject stateObj, Boolean isCommandProc, Boolean sync, TaskCompletionSource1 completion, Int32 startRpc, Int32 startParam)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, SqlDataReader ds, Boolean describeParameterEncryptionRequest)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource1 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.ExecuteReader(CommandBehavior behavior) at System.Data.EntityClient.EntityCommandDefinition.ExecuteStoreCommands(EntityCommand entityCommand, CommandBehavior behavior) at Ice.Services.Lib.RunTaskSvc.InnerRunTask(Int64 ipTaskNum, Boolean suppressTransaction) in C:\_Releases\ICE\3.1.500.8\Source\Server\Services\Lib\RunTask\RunTask.cs:line 526 at Ice.Services.Lib.RunTaskSvcFacade.RunTask(Int64 ipTaskNum) in C:\_Releases\ICE\3.1.500.8\Source\Server\Services\Lib\RunTask\RunTaskSvcFacade.cs:line 87 at SyncInvokeRunTask(Object , Object[] , Object[] ) at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs) at Epicor.Hosting.OperationBoundInvoker.InnerInvoke(Object instance, Func2 func) in C:_Releases\ICE\3.1.500.8\Source\Framework\Epicor.System\Hosting\OperationBoundInvoker.cs:line 59
at Epicor.Hosting.OperationBoundInvoker.Invoke(Object instance, Func`2 func) in C:_Releases\ICE\3.1.500.8\Source\Framework\Epicor.System\Hosting\OperationBoundInvoker.cs:line 28
at Epicor.Hosting.Wcf.EpiOperationInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs) in C:_Releases\ICE\3.1.500.8\Source\Framework\Epicor.System\Hosting\Wcf\EpiOperationInvoker.cs:line 23
at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage11(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)
at System.ServiceModel.Dispatcher.ChannelHandler.DispatchAndReleasePump(RequestContext request, Boolean cleanThread, OperationContext currentOperationContext)
at System.ServiceModel.Dispatcher.ChannelHandler.HandleRequest(RequestContext request, OperationContext currentOperationContext)
at System.ServiceModel.Dispatcher.ChannelHandler.AsyncMessagePump(IAsyncResult result)
at System.ServiceModel.Dispatcher.ChannelHandler.OnAsyncReceiveComplete(IAsyncResult result)
at System.Runtime.Fx.AsyncThunk.UnhandledExceptionFrame(IAsyncResult result)
at System.Runtime.AsyncResult.Complete(Boolean completedSynchronously)
at System.ServiceModel.Channels.TransportDuplexSessionChannel.TryReceiveAsyncResult.OnReceive(IAsyncResult result)
at System.Runtime.Fx.AsyncThunk.UnhandledExceptionFrame(IAsyncResult result)
at System.Runtime.AsyncResult.Complete(Boolean completedSynchronously)
at System.ServiceModel.Channels.SynchronizedMessageSource.ReceiveAsyncResult.OnReceiveComplete(Object state)
at System.ServiceModel.Channels.SessionConnectionReader.OnAsyncReadComplete(Object state)
at System.Runtime.Fx.AsyncThunk.UnhandledExceptionFrame(IAsyncResult result)
at System.Net.LazyAsyncResult.Complete(IntPtr userToken)
at System.Net.LazyAsyncResult.ProtectedInvokeCallback(Object result, IntPtr userToken)
at System.Net.Security.NegotiateStream.ProcessFrameBody(Int32 readBytes, Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.Security.NegotiateStream.ReadCallback(AsyncProtocolRequest asyncRequest)
at System.Net.AsyncProtocolRequest.CompleteRequest(Int32 result)
at System.Net.FixedSizeReader.CheckCompletionBeforeNextRead(Int32 bytes)
at System.Net.FixedSizeReader.ReadCallback(IAsyncResult transportResult)
at System.Runtime.AsyncResult.Complete(Boolean completedSynchronously)
at System.ServiceModel.Channels.ConnectionStream.IOAsyncResult.OnAsyncIOComplete(Object state)
at System.Net.Sockets.SocketAsyncEventArgs.OnCompleted(SocketAsyncEventArgs e)
at System.Net.Sockets.SocketAsyncEventArgs.FinishOperationSuccess(SocketError socketError, Int32 bytesTransferred, SocketFlags flags)
at System.Net.Sockets.SocketAsyncEventArgs.CompletionPortCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped)
at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)