Resource and transaction management:-
Typical business applications are cluttered with repetitive resource
management code. Many projects try to invent their own solutions, sometimes
sacrificing proper handling of failures for programming convenience. Spring
advocates simple solutions for proper resource handling, namely IoC through
templating in the case of JDBC and applying AOP interceptors for the ORM
technologies.
Spring introduces a DAO exception hierarchy, applicable to any data access
strategy. For direct JDBC, the
JdbcTemplate class mentioned in a previous
section provides connection handling and proper conversion of
SQLException
to the
DataAccessException hierarchy, including translation of
database-specific SQL error codes to meaningful exception classes. For ORM
technologies.
For the supported ORM technologies Spring offers
Hibernate, JPA and JDO
support through the Hibernate, JPA, and JDO
transaction managers as well
as
JTA support.