# Error message when attempting to use Generate Purchase Orders **Category:** [Epicor ERP 10](https://www.epiusers.help/c/e10/5) **Created:** 2016-11-08 23:16 UTC **Views:** 3882 **Replies:** 11 **URL:** https://www.epiusers.help/t/error-message-when-attempting-to-use-generate-purchase-orders/36155 --- ## Post #1 by @5775 After I run a Generate P.O. Suggestions report, then pull up New Purchase Orders and try to generate purchase orders I get the following message Application Error The transaction associated with the current connection has completed but has not been disposed. The transaction must be disposed before the connection can be used to execute SQL statement. --- ## Post #2 by @Bart_Elia Unless you have some advanced BPM c# code it's probably a bug in the core product based on your data and the scenario you were executing. Bundle up the scenario and contact support --- ## Post #3 by @Bart_Elia btw - make sure you grab the Event Logs - Windows Application or Epicor App Server. There will be an entry with all the details there. --- ## Post #4 by @5775 Thanks so much for replying. I will talk to my IT person. Thank you, Sandra Leisure Manufacturing Manager Columbia Industries --- ## Post #5 by @Jonathan_Lang I know this is an older post, but I did run across this error. To fix the issue I did a Regenerate Data Model. Just for future knowledge. --- ## Post #6 by @Theodorus_Gumilang Hi @Jonathan_Lang, do you have more steps? I encounter this issue today, and still can't make it right. --- ## Post #7 by @Jonathan Can you share the full error? Either from the server log or the windows even viewer. And also what version of the ERP you are using. --- ## Post #8 by @Theodorus_Gumilang Hi @Jonathan the error is the same as the above The transaction associated with the current connection has been completed but has not been disposed. The transaction must be disposed of before the connection can be used to execute the SQL statement. After some trial and error, I think we have a conclusion that this happens because of RevNum, after we change the RevNum we can Generate the Purchase Orders but we still don't know why we can't use the previous RevNum. Any Suggestion? --- ## Post #9 by @Jonathan I wanted the full error to see exactly where it comes from, the error stack will usually indicate the library/project and method which throws the error, with this I can take a look at the code and try to better guess what is happening. Transaction errors usually happen when a combination of nested transactions, new data contexts and unexpected exceptions occur, no idea without looking at the code of your specific scenario. --- ## Post #10 by @Theodorus_Gumilang Hi @Jonathan , so this is the full error log from the error. ``` Ice.Common.EpicorServerException: An error occurred while updating the entries. See the inner exception for details. ---> System.Data.Entity.Core.UpdateException: An error occurred while updating the entries. See the inner exception for details. ---> System.InvalidOperationException: The transaction associated with the current connection has completed but has not been disposed. The transaction must be disposed before the connection can be used to execute SQL statements. at System.Data.SqlClient.TdsParser.TdsExecuteRPC(SqlCommand cmd, _SqlRPC[] rpcArray, Int32 timeout, Boolean inSchema, SqlNotificationRequest notificationRequest, TdsParserStateObject stateObj, Boolean isCommandProc, Boolean sync, TaskCompletionSource`1 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, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest) 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.SqlClient.SqlCommand.ExecuteReader(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.Core.Objects.ObjectContext.SaveChangesInternal(SaveOptions options, Boolean executeInExistingTransaction) at Ice.IceDataContext.SaveChanges(SaveOptions options) in C:\_releases\ICE\ICE4.1.200.10\Source\Server\Framework\Epicor.System\Data\IceDataContext.cs:line 352 at Ice.IceDataContext.SaveChangesIfRowHasBeenChanged[TLinqRow](TLinqRow row) in C:\_releases\ICE\ICE4.1.200.10\Source\Server\Framework\Epicor.System\Data\IceDataContext.cs:line 538 at Ice.Triggers.TriggerQueue.RunWriteTriggerInNewLevel(IceDataContext context, LinqRow modifiedRecord, LinqRow originalRecord, Boolean forAddedRow) in C:\_releases\ICE\ICE4.1.200.10\Source\Server\Framework\Epicor.System\Triggers\TriggerQueue.cs:line 173 at Ice.Triggers.TriggerQueue.<>c__DisplayClass9_0.b__1() in C:\_releases\ICE\ICE4.1.200.10\Source\Server\Framework\Epicor.System\Triggers\TriggerQueue.cs:line 147 at Ice.Triggers.TriggerQueue.RunAtNewLevel(Func`1 buildTriggerRunState, Action action) in C:\_releases\ICE\ICE4.1.200.10\Source\Server\Framework\Epicor.System\Triggers\TriggerQueue.cs:line 501 at Ice.Triggers.TriggerQueue.RunTriggers(IceDataContext context) in C:\_releases\ICE\ICE4.1.200.10\Source\Server\Framework\Epicor.System\Triggers\TriggerQueue.cs:line 82 at Ice.IceDataContext.RunUntilAllTriggersHaveExecuted() in C:\_releases\ICE\ICE4.1.200.10\Source\Server\Framework\Epicor.System\Data\IceDataContext.cs:line 561 at Ice.IceDataContext.Validate() in C:\_releases\ICE\ICE4.1.200.10\Source\Server\Framework\Epicor.System\Data\IceDataContext.cs:line 280 at Erp.Services.BO.POSuggSvc.create_PoDetail(Int32 last_PONum, Int32 last_POLine) in C:\_releases\ERP\ERP11.1.200.0\Source\Server\Services\BO\POSugg\POSugg.cs:line 1892 at Erp.Services.BO.POSuggSvc.gen_PO_Dtl1(Int32& last_PONum, Int32& last_POLine, Int32& last_PORelNum, Int32& last_POMisc) in C:\_releases\ERP\ERP11.1.200.0\Source\Server\Services\BO\POSugg\POSugg.cs:line 2711 at Erp.Services.BO.POSuggSvc.gen_POs() in C:\_releases\ERP\ERP11.1.200.0\Source\Server\Services\BO\POSugg\POSugg.cs:line 2906 at Erp.Services.BO.POSuggSvc.Generate(POSuggTableset& ds, String ipPlantKey, String ipCurBuyer, Nullable`1 ipCutOffDate) in C:\_releases\ERP\ERP11.1.200.0\Source\Server\Services\BO\POSugg\POSugg.cs:line 3111 at Erp.Services.BO.POSuggSvcFacade.Generate(POSuggTableset& ds, String ipPlantKey, String ipCurBuyer, Nullable`1 ipCutOffDate) in C:\_releases\ERP\ERP11.1.200.0\Source\Server\Services\BO\POSugg\POSuggSvcFacade.cs:line 882 at SyncInvokeGenerate(Object , Object[] , Object[] ) at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs) at Epicor.Hosting.OperationBoundInvoker.InnerInvoke(Object instance, Func`2 func) in C:\_releases\ICE\ICE4.1.200.10\Source\Server\Framework\Epicor.System\Hosting\OperationBoundInvoker.cs:line 59 at Epicor.Hosting.OperationBoundInvoker.Invoke(Object instance, Func`2 func) in C:\_releases\ICE\ICE4.1.200.10\Source\Server\Framework\Epicor.System\Hosting\OperationBoundInvoker.cs:line 28 --- End of inner exception stack trace --- ``` --- ## Post #11 by @Jonathan I don't see any obvious issues in the code, transactions seem correctly scoped/handled. Are you processing a large amount of suggestions? Is the error thrown after the exact amount of time has passed everytime? --- ## Post #12 by @Theodorus_Gumilang Hi @Jonathan, the data is less than 10. I think is not because of the total of the suggestion. But it did throw an error after some RevNum was selected, but I can't figure out why the RevNum make the error --- **Canonical:** https://www.epiusers.help/t/error-message-when-attempting-to-use-generate-purchase-orders/36155 **Original content:** https://www.epiusers.help/t/error-message-when-attempting-to-use-generate-purchase-orders/36155