posted 17 years ago
I'm implimenting my Torque DAO for 2.1.7 and have noticed that the most of the DAO interfaces drop the "throws exception" clause. And I can see that the existing DAO implimentations now wrap this with a DatabaseException.
I'm wondering what the logic was to make this change.
The problem I have with this is that the jForum error writer does not do a good job of writing traces back to the original root cause. E.g., Try finding the actual problem from an SQL Exception that is wrapped in a TorqueException that then gets wrapped in a DatabaseException. FWIW, I also know that the same kind of Exception wrapping can occure with some LDAP and ActiveDirectory access tools as well.
IMHO, if you are going to have a generic interface, you need to either do a good job of reporting root causes or allow the implimentors to throw their native exceptions. Also throwing a generic Exception should remind the core code writers to think about the fact that someone might be using an implimentation that they never thought about and add appropriate error checking/recovery code.
Anyway, any chance the DAO methods could be rolled back to include throws Exception again?
TIA
Greg
[originally posted on jforum.net by monroe]