Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding hook into SQL State based exception translation [SPR-4899] #9575

Closed
spring-projects-issues opened this issue Jun 8, 2008 · 1 comment
Labels
in: data Issues in data modules (jdbc, orm, oxm, tx) type: enhancement A general enhancement
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Jun 8, 2008

Abhishek Gupta opened SPR-4899 and commented

REF: #9549 http://jira.springframework.org/browse/SPR-4873

Futher to jira:SPR-4873, there is a need to provide a hook for being able to add new SQL States that might be needed to classify exceptions.

  • Currently, the logic is hardcoded in the SQLStateSQLExceptionTranslator class and if a new SQLState needs to be classified there is no extensible way of doing this. Every database tends to have its own set of SQLStates (eg. Sybase sql-states mentioned in Improve classification of DB2 and Sybase exceptions by adding new error-state classifications [SPR-4873] #9549)

  • A file based approach to override existing SQLState based classification and add new ones would be very useful (The same way it is currently provided for in SQL error-code based classification)

  • Currently the SQLStateSQLExceptionTranslator class classifies into four types of exceptions viz. BadSqlGrammarException, DataIntegrityViolationException, DataAccessResourceFailureException and ConcurrencyFailureException.
    All the exception categories provided in SQLErrorCodeSQLExceptionTranslator need to be provided for SQL State based classification as well.

  • There is no classification for TransientDataAccessResourceException. This needs to be added as well.


Affects: 2.5.2, 2.5.3, 2.5.4

Issue Links:

Referenced from: commits 9b1edea, 49549d6

@spring-projects-issues
Copy link
Collaborator Author

Abhishek Gupta commented

Hi,
The original Fix Version for this jira was 2.5.6.
This issue is stopping us from adopting spring-based exception translation and replacing our homegrown one.
It would really help us comepletly replace our existing sql-state based error-handling if this could be provided in 2.5.6

Thanks,
Abhi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: data Issues in data modules (jdbc, orm, oxm, tx) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

1 participant