Print Page | Close Window

System.Data.DuplicateNameException

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce Classic
Forum Discription: For .NET 2.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=3671
Printed Date: 21-Jan-2026 at 7:09pm


Topic: System.Data.DuplicateNameException
Posted By: chris94530
Subject: System.Data.DuplicateNameException
Date Posted: 26-Sep-2012 at 1:42pm
I am accessing an ideablade object and occaisionally getting the following error... Any ideas on what could cause this?
System.Data.DuplicateNameException: A DataTable named 'Model:FacilityArea' already belongs to this DataSet.
   at System.Data.DataTableCollection.RegisterName(String name, String tbNamespace)
   at System.Data.DataTableCollection.BaseAdd(DataTable table)
   at System.Data.DataTableCollection.Add(DataTable table)
   at IdeaBlade.Persistence.PersistenceManager.AddTable(EntityTable pEntityTable)
   at IdeaBlade.Persistence.PersistenceManager.CreateTableAndInitialize(Type pEntityType)
   at IdeaBlade.Persistence.PersistenceManager.GetTable(Type pEntityType)
   at IdeaBlade.Persistence.PersistenceManager.ArePrimaryKeyColumns(EntityColumn[] pEntityColumns)
   at IdeaBlade.Persistence.PersistenceManager.XGetRelated(ICollection pEntities, EntityRelationLink pRelationLink, QueryStrategy pQueryStrategy, WorkState pWorkState)
   at IdeaBlade.Persistence.PersistenceManager.GetParent(Entity pEntity, EntityRelation pEntityRelation, QueryStrategy pQueryStrategy)
   at IdeaBlade.Persistence.PersistenceManager.GetParent[T](Entity pEntity, EntityRelation pEntityRelation, QueryStrategy pQueryStrategy)
   at IdeaBlade.Persistence.Entity.GetParent[T](EntityRelation pRelation, QueryStrategy pStrategy)
   at Model.SessionManifestDataRow.GetFacilityAreaImpl()
   at Model.SessionManifestDataRow.get_FacilityArea()
   at Session_Export.mSessionExportForm.mSessionUltraGrid2_BeforeCellActivate_1(Object sender, CancelableCellEventArgs e)
 
The line of code that generates this is...
 

Dim mSessionArea As String = mSession.SessionManifest.FacilityArea.ToString()

 



Replies:
Posted By: kimj
Date Posted: 26-Sep-2012 at 2:38pm
Odd and occasional DataTable or metadata errors usually indicate a multi-threading issue of some sort.  Which DevForce Classic version are you running?


Posted By: chris94530
Date Posted: 28-Sep-2012 at 7:25am
3.6.8.1


Posted By: kimj
Date Posted: 28-Sep-2012 at 9:26am
We did fix a few thread safety problems in the 3.7.3 release last year, but it's not clear those fixes would help here.   The PersistenceManager is not thread safe, by intention, but shared metadata and other structures are. 
 
Are you doing any multi-threading in your application?  Can you tell me anything more about when you see the error?



Print Page | Close Window