Print Page | Close Window

IdeaBlade throws errors that do not identify where the problem is

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=226
Printed Date: 29-Aug-2025 at 8:06pm


Topic: IdeaBlade throws errors that do not identify where the problem is
Posted By: Customer
Subject: IdeaBlade throws errors that do not identify where the problem is
Date Posted: 12-Jul-2007 at 4:31pm

It would be really nice if when an error was thrown from IdeaBlade with a problem saving (PersistenceManagerSaveException), the exception contained the name of the table and/or field that it was trying to update, or the name of the Data class would be helpful also.

 

What we get now is errors that look like the following, where it's almost impossible to determine where the problem is, even if watching the SQL Trace or looking in the DebugLog.xml file.

 

IdeaBlade.Persistence.PersistenceManagerSaveException: Save failed - Table doesn't have a primary key. --->

System.Data.MissingPrimaryKeyException: Table doesn't have a primary key.

   at System.Data.DataTable.FindByPrimaryKey(Object[] values)

   at System.Data.DataRowCollection.Find(Object[] keys)

   at IdeaBlade.Persistence.PersistenceManager.FindEntity(PrimaryKey

pPrimaryKey)

   at IdeaBlade.Persistence.PersistenceManager.GetEntity(PrimaryKey

pPrimaryKey, QueryStrategy pQueryStrategy)

   at IdeaBlade.Persistence.PersistenceManager.GetEntity(PrimaryKey

pPrimaryKey)

   at

IdeaBlade.Persistence.PersistenceManager.GetEntitiesWithErrors(DataSet

pDataSet, Boolean pRemoveFromDataSet)

   at IdeaBlade.Persistence.PersistenceManager.SaveDataSet(IEnumerable

pDataRows, SaveOptions pSaveOptions)

   at IdeaBlade.Persistence.PersistenceManager.DoSaveDataSet(IEnumerable

pDataRows, SaveOptions pSaveOptions)

   --- End of inner exception stack trace ---

   at IdeaBlade.Persistence.PersistenceMa

nager.DoSaveDataSet(IEnumerable pDataRows, SaveOptions pSaveOptions)

   at IdeaBlade.Persistence.PersistenceManager.SaveChanges(IEnumerable

pDataRows, SaveOptions pSaveOptions)

   at IdeaBlade.Persistence.PersistenceManager.SaveChanges()

   at

Wolf.Export.Mapping.Copd.CopdPatient.SaveToDatabase(CopdPatientData

data) in C:\WolfDev\DotNet2\Export2\Mapping\Copd\CopdPatient.cs:line 233

   at Wolf.Export.Mapping.Copd.CopdPatient.ImportPatient(String

fileName, Boolean[] options) in

C:\WolfDev\DotNet2\Export2\Mapping\Copd\CopdPatient.cs:line 201

   at Wolf.Export.Mapping.Copd.Copd.ImportPatient(String fileName, Boolean[] options) in C:\WolfDev\DotNet2\Export2\Mapping\Copd\Copd.cs:line 155

   at Wolf.Export.UI.Steps.IntImportFilter.Import(Copd importengine, PersistenceManager pm, BackgroundWorker w, String file, Int32 pos, Int32

max) in C:\WolfDev\DotNet2\ExportUI\Steps\IntImportFilter.cs:line 319




Replies:
Posted By: IdeaBlade
Date Posted: 12-Jul-2007 at 4:34pm
In general, when a save error occurs, EntititiesWithErrors will give you all of the information you need to know with respect to the Entity causing the error (including the table name).  However, the exception to this rule occurs when the PersistenceManager encounters a fatal error during the processing of the calculation of EntitiesWithErrors.  In your case, the EntityWithErrors does not have a Primary Key.

 

You should have received an error message from the Object Mapper.  It usually prints an error message when it finds a table with a missing primary key.

 

If you think this analysis is incorrect, please supply us with evidence to the contrary such as a reproducible case.




Print Page | Close Window