IDbToBusinessEntityNameMapper and HandleSqlException

Dec 12, 2007 at 3:36 PM
I suggest removing IDbToBusinessEntityNameMapper from the factory interfaces so that the decision to inherit from this interface (and therefore be required to implement MapDbParameterToBusinessEntityProperty) can be made on a per repository basis. While I can see the benefits of this interface, I have chosen not to use this functionality, and expect others have done the same (in part because of the below issue).

Based on my experience and review of existing discussions, there are known issues with how many SQL exceptions are handled in the HandleSqlException method (reported exception information is often incorrect because the original error number is not being evaluated). Until these issues are addressed, I would further recommend that calls to HandleSqlException be replaced with throws to RepositoryFailureException in the code generated in <Entity>Repository.cs.

I appreciate any feedback, especially if I am mistaken in my understanding of this issue.
Dec 14, 2007 at 6:16 PM
These threads provide additional insight into the problem with the HandleSqlException method:

http://www.codeplex.com/RepositoryFactory/WorkItem/View.aspx?WorkItemId=5835
http://www.codeplex.com/servicefactory/WorkItem/View.aspx?WorkItemId=4295
http://www.codeplex.com/servicefactory/Thread/View.aspx?ThreadId=11097