Error "Column 'COMPOSERID_' is constrained to be unique"
search cancel

Error "Column 'COMPOSERID_' is constrained to be unique"

book

Article ID: 176787

calendar_today

Updated On:

Products

Workflow Solution

Issue/Introduction

The following error message is displayed during execution of a Workflow project. What causes this error?

Error Details

Error Message:
Column 'COMPOSERID_' is constrained to be unique. Value '24409237' is already present.

Message Stack:
at System.Data.UniqueConstraint.CheckConstraint(DataRow row, DataRowAction action)
at System.Data.DataTable.RaiseRowChanging(DataRowChangeEventArgs args, DataRow eRow, DataRowAction eAction, Boolean fireEvent)
at System.Data.DataTable.SetNewRecordWorker(DataRow row, Int32 proposedRecord, DataRowAction action, Boolean isInMerge, Int32 position, Boolean fireEvent, Exception& deferredException)
at System.Data.DataTable.InsertRow(DataRow row, Int32 proposedID, Int32 pos, Boolean fireEvent)
at System.Data.DataRowCollection.Add(DataRow row)
at LogicBase.Components.FormBuilder.AdvancedComponents.GridView.GridViewComponentRenderer.GetDataTableWrapper(ICollection dataCollection) in c:\Stuff\projects\platform2006\components\LogicBase.Components.FormBuilder.Advanced\GridView\GridViewComponentRenderer.cs:line 292
at LogicBase.Components.FormBuilder.AdvancedComponents.GridView.GridViewComponentRenderer.ExtractCurrentDataSource(IData data, GridViewComponent gridViewComponent) in c:\Stuff\projects\platform2006\components\LogicBase.Components.FormBuilder.Advanced\GridView\GridViewComponentRenderer.cs:line 236
at LogicBase.Components.FormBuilder.AdvancedComponents.GridView.GridViewComponentRenderer.ProtectedRenderControl(IFormComponent formComponent, RenderingContext context, IData data, WebControl webControl) in c:\Stuff\projects\platform2006\components\LogicBase.Components.FormBuilder.Advanced\GridView\GridViewComponentRenderer.cs:line 53
at LogicBase.Components.FormBuilder.Core.AbstractFormComponentRenderer.RenderControl(IFormComponent component, RenderingContext context, IData data, WebControl control) in c:\Stuff\projects\platform2006\components\LogicBase.Components.FormBuilder\Core\AbstractFormComponentRenderer.cs:line 83
at LogicBase.Components.FormBuilder.Core.AbstractFormComponentRenderer.RenderControl(IFormComponent component, RenderingContext context) in c:\Stuff\projects\platform2006\components\LogicBase.Components.FormBuilder\Core\AbstractFormComponentRenderer.cs:line 45
at LogicBase.Components.FormBuilder.FormBuilderComponentRenderer.Load(IData data) in c:\Stuff\projects\platform2006\components\LogicBase.Components.FormBuilder\FormBuilderComponentRenderer.cs:line 81
at LogicBase.Components.FormBuilder.FormBuilderComponent.DoContinue(HttpContext context, IData data) in c:\Stuff\projects\platform2006\components\LogicBase.Components.FormBuilder\FormBuilderComponent.cs:line 649
at LogicBase.Core.AbstractDialogComponent.AbstractASPXDialogComponent.Continue(HttpContext context, IData data) in c:\Stuff\projects\platform2006\core\LogicBase.Core\Interfaces\DialogComponents.cs:line 191
at LogicBase.Core.Models.Dialog.ASPXDialogExecutionDelegate.ContinueInteraction(IData data, IOrchestrationComponent comp, AbstractExecutionEngine engine, TLExecutionContext ec) in c:\Stuff\projects\platform2006\core\LogicBase.Core\Models\Dialog\DialogExecutionEngine.cs:line 1602
at LogicBase.Core.Models.Dialog.AbstractDialogExecutionEngine.ProcessLoad() in c:\Stuff\projects\platform2006\core\LogicBase.Core\Models\Dialog\DialogExecutionEngine.cs:line 112
at LogicBase.Core.Models.Dialog.ComposerForm.OnLoad(EventArgs e) in c:\Stuff\projects\platform2006\core\LogicBase.Core\Models\Dialog\ComposerForm.cs:line 85
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

Resolution

The error is a result of adding the same member of one collection to another collection (more than once). The easiest solution is to create a new instance of the source object, copy the data into the new instance, then add that new instance to the destination array. The illustrations below may help in understanding:

Use of Dynamic Mapping in this component will copy the data, and create a new instance in the destination array in one step.


Attachments