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