|
From: Juergen H. <ju...@in...> - 2005-03-21 10:11:53
|
Good point. Even if client code can't react specifically, we might want to log it specifically to be able to track down deadlocks. I guess the main problem is to track down the exact DeadlockLoserDataAccessException error codes for each database. We need to make sure that the error code actually always indicates a deadlock, rather than just a "cannot acquire lock", even if the SQLException message says something about a deadlock. Juergen -----Original Message----- From: spr...@li... [mailto:spr...@li...]On Behalf Of Rod Johnson Sent: Monday, March 21, 2005 10:56 AM To: spr...@li... Subject: Re: [Springframework-developer] DeadlockLoserDataAccessException vs CannotAcquireLockException > Fine-granular exceptions are fine, of course, but I guess the main driver > should be the needs of data access client code. If client code is unable to > react specifically, it's arguably good enough to discriminate actual failure > causes through the exception message. On the other hand, there are always > special clients with special needs... I think we should capture more information. It IS possible. Exception messages are only useful for logging: they're useless to calling code. The beauty of using exception subclasses is that the client needs to worry only to whatever granularity they choose. So nothing is lost by having the finer-grained classes (assuming they do get thrown). There definitely are situations where knowing about deadlocks makes a lot of sense--for example, consider adding an aspect that logged the frequency of deadlocks and the context, to help in correcting a design flaw. And I've seen applications where people needed to find out about deadlocks, for whatever reason. R ------------------------------------------------------- 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://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ Springframework-developer mailing list Spr...@li... https://lists.sourceforge.net/lists/listinfo/springframework-developer |