[Springnet-commits] Spring.Net/doc/reference/src dao.xml,1.2,1.3
Brought to you by:
aseovic,
markpollack
From: Mark P. <mar...@us...> - 2007-12-06 20:14:27
|
Update of /cvsroot/springnet/Spring.Net/doc/reference/src In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv5914 Modified Files: dao.xml Log Message: SPRNET-457 - ErrorCode translation can produce extraneous UncategorizedDataAccessException Index: dao.xml =================================================================== RCS file: /cvsroot/springnet/Spring.Net/doc/reference/src/dao.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** dao.xml 30 Sep 2006 16:18:24 -0000 1.2 --- dao.xml 6 Dec 2007 20:14:22 -0000 1.3 *************** *** 14,18 **** activities to objects that implement these data access interfaces. These objects are commonly referred to as DAOs (Data Access Objects) and the ! architectural layer as a DAL (Data Access Layer). </para> <para>The benefits of using a DAOs in your application are increased --- 14,18 ---- activities to objects that implement these data access interfaces. These objects are commonly referred to as DAOs (Data Access Objects) and the ! architectural layer as a DAL (Data Access Layer).</para> <para>The benefits of using a DAOs in your application are increased *************** *** 23,27 **** is beneficial because tests that rely on the database are usually hard to setup and tear down and also are impractical for testing exceptional ! behavior. </para> <para>The Data Access Object (DAO) support in Spring is aimed at making it --- 23,27 ---- is beneficial because tests that rely on the database are usually hard to setup and tear down and also are impractical for testing exceptional ! behavior.</para> <para>The Data Access Object (DAO) support in Spring is aimed at making it *************** *** 51,55 **** wrong. This error code is different across providers for the same conceptual error, such as a violation of data integrity or providing bad ! SQL grammar. </para> <para>To promote writing portable and descriptive exception handling code --- 51,55 ---- wrong. This error code is different across providers for the same conceptual error, such as a violation of data integrity or providing bad ! SQL grammar.</para> <para>To promote writing portable and descriptive exception handling code *************** *** 71,75 **** meaning that one can perform some operations with ADO.NET within a consistent programming model. The above holds true for the various ! template-based versions of the ORM access framework. </para> <para>The exception hierarchy that Spring uses is outlined in the --- 71,75 ---- meaning that one can perform some operations with ADO.NET within a consistent programming model. The above holds true for the various ! template-based versions of the ORM access framework.</para> <para>The exception hierarchy that Spring uses is outlined in the *************** *** 84,88 **** <para>(Please note that the class hierarchy detailed in the above image shows only a subset of the whole, rich, ! <classname>DataAccessException</classname> hierarchy.) </para> <para>The exception translation functionality is in the namespace --- 84,88 ---- <para>(Please note that the class hierarchy detailed in the above image shows only a subset of the whole, rich, ! <classname>DataAccessException</classname> hierarchy.)</para> <para>The exception translation functionality is in the namespace *************** *** 103,115 **** <para>A default implementation, <literal>ErrorCodeExceptionTranslator</literal>, is provides that uses the ! configuration file sql-error-codes.xml to define the exact mappings of ! error codes to Spring DataAccessExceptions. You can use this API directly ! in your own Spring independent data layer. If you are using Spring's ! ADO.NET abstraction class, <literal>AdoTemplate</literal>, the converted ! exceptions will be thrown automatically. Somewhere in between these two ! cases is using Spring's declarative transaction management features in ! .NET 2.0 with the raw ADO.NET APIs and using <literal>IAdoExceptionTranslator</literal> in your exception handling ! layer. </para> <para>Some of the more common exceptions are described here. Please refer --- 103,129 ---- <para>A default implementation, <literal>ErrorCodeExceptionTranslator</literal>, is provides that uses the ! error codes defined in for each data provider in the file dbproviders.xml. ! Refer to this file for the exact mappings of error codes to Spring ! DataAccessExceptions. <classname>ErrorCodeExceptionTranslator</classname> ! allows you to customize the mapping behavior without having customize the ! <classname>IDbProvider</classname> metadata (typically in dbproviders.xml ! but can also be defined in an external location). .You can subclass ! <classname>ErrorCodeExceptionTranslator</classname> and override the ! method, <literal>DataAccessException TranslateException(string task, ! string sql, string errorCode, Exception exception)</literal>. This will ! called before referencing the metadata to perform exception translation. ! The property <literal>ExceptionTranslator</literal> on ! <literal>AdoTemplate</literal> and <literal>HibernateTemplate</literal> ! let you use your own custom implementation.</para> ! ! <para>When You can use this API directly in your own Spring independent ! data layer. If you are using Spring's ADO.NET abstraction class, ! <literal>AdoTemplate</literal>, or <literal>HibernateTemplate</literal>, ! the converted exceptions will be thrown automatically. Somewhere in ! between these two cases is using Spring's declarative transaction ! management features in .NET 2.0 with the raw ADO.NET APIs and using <literal>IAdoExceptionTranslator</literal> in your exception handling ! layer (which might be implemented in AOP using Spring's exception ! translation aspect).</para> <para>Some of the more common exceptions are described here. Please refer |