2013년 1월 30일 수요일

DataAccessException API

'쉽게 따라하는 자바 웹개발'에서 SqlMapClient만을 사용해서 코딩하면 나타나는 불편함 중에서 SQLException에 관한 부분이 있다. 그것과 관련한 API인데 해석을 해보니 영 이해가 안된다. 향후 편집이 필요하다.

org.springframework.dao 

Class DataAccessException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.lang.RuntimeException
              extended by org.springframework.core.NestedRuntimeException
                  extended by org.springframework.dao.DataAccessException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
CleanupFailureDataAccessExceptionConcurrencyFailureExceptionDataAccessResourceFailureExceptionDataIntegrityViolationException,DataRetrievalFailureExceptionInvalidDataAccessApiUsageExceptionInvalidDataAccessResourceUsageExceptionUncategorizedDataAccessException

public abstract class DataAccessException
extends NestedRuntimeException
Root of the hierarchy of data access exceptions discussed in Expert One-On-One J2EE Design and Development. Please see Chapter 9 of this book for detailed discussion of the motivation for this package.

책 'ExpertOne-On-One J2EE Design and Development' 에서 논의된 데이터접근 예외에 대한 계층의 근원. 책의 9장에 나와있는 이 패키지에 대한 모티브와 관련한 상세한 논쟁을 살펴보길 권한다.

This exception hierarchy aims to let user code find and handle the kind of error encountered without knowing the details of the particular data access API in use (e.g. JDBC). Thus it is possible to react to an optimistic locking failure without knowing that JDBC is being used.
As this class is a runtime exception, there is no need for user code to catch it or subclasses if any error is to be considered fatal (the usual case).

이 예외 계층은 사용자가 코드를 찾도록 그리고 특정 데이터접근 API의 상세정보를 모를 때 맞딱드리는 것과 같은 종류의 에러를 다룰 수 있도록 지원한다. 그래서 사용되는 JDBC에 대한 인지없이 낙관적인 잠금 실패에 반응하는게 가능하다.
이 클래스는 런타임 예외이기때문에, 만일 어떤 에러라도 치명적(일반적인 경우)으로 간주된다면, 에러나 하위 클래스를 잡기위해 사용자가 코딩할 필요가 없다.


Author:
Rod Johnson
See Also:
Serialized Form

댓글 없음 :

댓글 쓰기