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
- IncorrectResultSizeDataAccessException
- InvalidDataAccessResourceUsageException
- IncorrectUpdateSemanticsDataAccessException
- JdbcUpdateAffectedIncorrectNumberOfRowsException
- TypeMismatchDataAccessException
- BadSqlGrammarException
- InvalidResultSetAccessException
- IncorrectUpdateSemanticsDataAccessException
- InvalidDataAccessApiUsageException
- NonTransientDataAccessResourceException
- PermissionDeniedDataAccessException
- UncategorizedDataAccessException
- SQLWarningException
- UncategorizedSQLException
- RecoverableDataAccessException
- TransientDataAccessException
- ConcurrencyFailureException
- OptimisticLockingFailureException
- PessimisticLockingFailureException
- CannotAcquireLockException
- CannotSerializeTransactionException
- DeadlockLoserDataAccessException
- TransientDataAccessResourceException
- ConcurrencyFailureException
- NonTransientDataAccessException
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
Keine Kommentare:
Kommentar veröffentlichen