|
From: <tho...@tr...> - 2004-12-01 23:03:49
|
Forgot that the issue was regarding DeadlockLoserDataAccessException. You could still use the custom translation - just modify the codes and exception thrown. Don't know if this is common enough to warrant its own exception category. What do yuo think? Thomas Quoting tho...@tr...: > Craig & Juergen, > > We recently added categories for OptimisticLockingFailure and > CannotAcquireLock. > We could also add a category for CannotSerializeTransaction - I could add it > for next release. In the meantime you can use our custom translation feature > - > here is an example of an sql-error-codes.xml file with a custom translation > added for Oracle: > > <beans> > > <bean id="Oracle" class="org.springframework.jdbc.support.SQLErrorCodes"> > <property name="badSqlGrammarCodes"> > <value>900,903,904,917,936,942,17006</value> > </property> > <property name="dataIntegrityViolationCodes"> > <value>1,1400,1722,2291</value> > </property> > <property name="cannotAcquireLockCodes"> > <value>54</value> > </property> > <property name="customTranslations"> > <list> > <bean > > class="org.springframework.jdbc.support.CustomSQLErrorCodesTranslation"> > <property name="errorCodes"> > <value>8177</value></property> > <property name="exceptionClass"> > > <value>org.springframework.dao.CannotSerializeTransactionException</value> > </property> > </bean> > </list> > </property> > </bean> > > </beans> > > This will catch any ORA-08177 errors and throw a > CannotSerializeTransactionException. > > Thomas > > > > Quoting "jürgen höller [werk3AT]" <jue...@we...>: > > > Thomas, everybody, > > > > A valid point. Any ideas on this? > > > > Juergen > > > > > > ________________________________ > > > > Von: spr...@li... im Auftrag von Craig > > Shearer > > Gesendet: Mi 01.12.2004 22:38 > > An: spr...@li... > > Betreff: [Springframework-user] DeadlockLoserDataAccessException > > > > > > > > Hello all Springers > > > > We're using Spring in conjunction with Hibernate, and MySQL, and we're > > trying to deal with deadlock situations. Right now, when the database > > encounters a deadlock, it gets thrown as an > > UncategorizedDataAccessException. What we'd like is for deadlocks to be > > thrown as the specific DeadlockLoserDataAccessException. > > > > So, I did a little reading on this, and read some of the Spring source. It > > appears that although the DeadlockLoserDataAccessException class exists, it > > is not thrown anywhere. Now, I've read the source code for the > SQLErrorCodes > > class, expecting to be able to supply a customised sql-error-codes.xml > file, > > but it appears there is no facility to specify deadlock codes. > > > > Does anybody have any comment on this? We could enhance the SQLErrorCodes > > class ourselves and submit it as a patch, or perhaps somebody else has a > > solution. (Or am I on the wrong track entirely?) > > > > Regards, > > > > Craig Shearer > > > > Senior Technical Architect > > GFG Group > > http://www.gfg-group.com > > mailto:csh...@gf... > > > > Phone: +64 (0) 9 966 7097 > > Mobile: +64 (0) 27 4936 334 > > > > > > > > > > > > ------------------------------------------------------- > > SF email is sponsored by - The IT Product Guide > > Read honest & candid reviews on hundreds of IT Products from real users. > > Discover which products truly live up to the hype. Start reading now. > > http://productguide.itmanagersjournal.com/ > > _______________________________________________ > > Springframework-user mailing list > > Spr...@li... > > https://lists.sourceforge.net/lists/listinfo/springframework-user > > > > > > > > > > ------------------------------------------------------- > > SF email is sponsored by - The IT Product Guide > > Read honest & candid reviews on hundreds of IT Products from real users. > > Discover which products truly live up to the hype. Start reading now. > > http://productguide.itmanagersjournal.com/ > > _______________________________________________ > > Springframework-developer mailing list > > Spr...@li... > > https://lists.sourceforge.net/lists/listinfo/springframework-developer > > > > > > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real users. > Discover which products truly live up to the hype. Start reading now. > http://productguide.itmanagersjournal.com/ > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer > |