|
From: <tri...@tr...> - 2004-02-11 17:25:55
|
This has come up a couple of times, but we have never really committed to adding additional exception categories. We are currently supporting translation to: DataIntegrityViolationException BadSqlGrammarException Suggested categories to add (from my recollection): DataRetrievalFailureException OptimisticLockingFailureException DataAccessResourceFailureException Do we want to add some additional categories to the SQLErrorCodeSQLExceptionTranslator? If we do, we could keep it backwards compatible by making these additional categories optional based on entries in sql-error-codes.xml. If we decide to add this, when would be a good time considering RC1 being released any minute? Thomas Quoting Meier Martin <mar...@el...>: > Hi, > > I tried to map a stale connection error code to a > DataAccessResourceFailureException, but this did not work: > > <bean id="Oracle" class="org.springframework.jdbc.support.SQLErrorCodes"> > <property > name="badSqlGrammarCodes"><value>900,903,904,917,936,942,17006</value></prop > erty> > <property > name="dataIntegrityViolationCodes"><value>1,1400,1722,2291</value></property > > > <property > name="dataIntegrityViolationCodes"><value>1,1400,1722,2291</value></property > > > <property > name="dataAccessResourceFailureCodes"><value>17002</value></property> > </bean> > > As I saw in the class SQLErrorCodes only the methods > setBadSqlGrammerCodes(...) and setDataIntegrityViolationCodes(...) are > supported. How is it possible to map an error code to a > dataAccessResourceFailureException with the sql-error-codes.xml? > > Cheers > -Martin > |