Posts mit dem Label Spring werden angezeigt. Alle Posts anzeigen
Posts mit dem Label Spring werden angezeigt. Alle Posts anzeigen

Sonntag, 12. August 2012

Spring DAO Exceptions List


Hi all,
I’m coding a global exception wrapping class, which should be automatically create a user-friendly message for every DataAccessException thrown by spring. Although I wasn’t able to find a list of all possible exceptions, so I checked out the spring-tx-<version>.jar and found following exceptions with derived exceptions and because I’m using Spring-JDBC for DatabaseConnection, I also added the Spring-JDBC-Exceptions in red.
  • DataAccessExcpeption
    • NonTransientDataAccessException
      • CleanupFailureDataAccessException
      • DataAccessResourceFailureException
        • CannotGetJdbcConnectionException
      • DataIntegrityViolationException
        • DuplicateKeyException
      • DataRetrievalFailureException
        • IncorrectResultSizeDataAccessException
          • EmptyResultDataAccessException
        • IncorrectResultSetColumnCountException
        • LobRetrievalFailureException
      • InvalidDataAccessResourceUsageException
        • IncorrectUpdateSemanticsDataAccessException
          • JdbcUpdateAffectedIncorrectNumberOfRowsException
        • TypeMismatchDataAccessException
        • BadSqlGrammarException
        • InvalidResultSetAccessException
      • InvalidDataAccessApiUsageException
      • NonTransientDataAccessResourceException
      • PermissionDeniedDataAccessException
      • UncategorizedDataAccessException
        • SQLWarningException
        • UncategorizedSQLException
    • RecoverableDataAccessException
    • TransientDataAccessException
      • ConcurrencyFailureException
        • OptimisticLockingFailureException
        • PessimisticLockingFailureException
          • CannotAcquireLockException
          • CannotSerializeTransactionException
          • DeadlockLoserDataAccessException
      • TransientDataAccessResourceException
Additionally to the DAO and JDBC Exceptions, here are the Transaction-Exceptions:


  • TransactionException
    • CannotCreateTransactionException
      • NestedTransactionNotSupportedException
      • TransactionSuspensionNotSupportedException
    • HeuristicCompletionException
    • TransactionSystemException
    • TransactionTimeOutException
    • TransactionUsageException
      • IlegalTransactionStateException
      • InvalidIsolationLevelException
      • InvalidTimeoutException
      • NoTransactionException
    • UnexpectedRollbackException

Happy Coding