|
From: James C. <jim...@do...> - 2004-12-02 14:03:59
|
Most large enterprise applications will suffer from deadlock exceptions especially when delegating SQL to an ORM mapping tool that decides when = to flush SQL and in what order to issue statements. Because SQL execution = order is out of the hands of the developer, the only other means we have at preventing deadlocks is careful specification of page/row level locking. Many people want to respond to a deadlock exception by simply retrying = the query. They don't always realize that once a deadlock exception occurs, = the transaction is rolling back (at least in the databases that I am = familiar with). A retry can be effective, but the entire transaction must be = retried. That said, a means of differentiating a deadlock exception from other = types of fatal (to the transaction) exceptions would be useful. > -----Original Message----- > From: spr...@li... > [mailto:spr...@li...] On = Behalf > Of tho...@tr... > Sent: Wednesday, December 01, 2004 6:04 PM > To: spr...@li... > Subject: Re: [Springframework-developer] Fw: [Springframework-user] > DeadlockLoserDataAccessException >=20 > 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? >=20 > Thomas >=20 >=20 > Quoting tho...@tr...: >=20 > > 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=3D"Oracle" > class=3D"org.springframework.jdbc.support.SQLErrorCodes"> > > <property name=3D"badSqlGrammarCodes"> > > <value>900,903,904,917,936,942,17006</value> > > </property> > > <property name=3D"dataIntegrityViolationCodes"> > > <value>1,1400,1722,2291</value> > > </property> > > <property name=3D"cannotAcquireLockCodes"> > > <value>54</value> > > </property> > > <property name=3D"customTranslations"> > > <list> > > <bean > > > > = class=3D"org.springframework.jdbc.support.CustomSQLErrorCodesTranslation"= > > > <property name=3D"errorCodes"> > > <value>8177</value></property> > > <property name=3D"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=FCrgen h=F6ller [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 > > >=20 >=20 >=20 >=20 >=20 > ------------------------------------------------------- > 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 |