[OJB-developers] RE: Exceptions
Brought to you by:
thma
From: John F. <jfr...@so...> - 2002-05-07 15:46:10
|
I'm all ears, but I've just been very busy lately. Regarding my second item, after thinking about it some I would prefer to change the PB interface and start using RsIterator that can throw PBEs as necessary. Down the road there will probably be other features where it would be handy not to be constrained by java.util.Iterator all the time. I've got a bunch of patches to submit for private PB tx consistent caches, a shared read-only cache, etc. I just need to find the time to prepare the files and mail them into somebody. Cheers, - John > -----Original Message----- > From: Joa...@tp... [mailto:Joa...@tp...] > Sent: Tuesday, May 07, 2002 6:29 AM > To: obj...@li... > Cc: John Freeborg > Subject: Exceptions >=20 >=20 > Hy, >=20 > once again I got some issues with Exception handling. There are many=20 > places in the code where Throwable is caught. I think this is=20 > quite bad,=20 > because most of the times it is just re-thrown as a different=20 > exception=20 > (often resulting in lost information). The problem is=20 > increased when the=20 > re-thrown Exception is a ODMG-Exception, as in this case we=20 > can't use the=20 > cause-exception system that I added to PersistenceBrokerException. To=20 > enhance the situation I've got two suggestions. One of them has been=20 > suggested by John Freeborg on 17. 4. 2002 (mail to be found at=20 > http://sourceforge.net/mailarchive/forum.php?thread_id=3D645206& forum_id=3D4880)=20 but unfortunately noone anwsered and he hasn't posted since. - stop excessive use of "catch (Throwable foo)" in favour of more specific=20 catch-clauses (see Mail-Archive-Link for details). - throw a custom subclass of ODMGException/LockNotGrantedException/...=20 instead of the original to make use of the same mechanism that I added to=20 PersistenceBrokerException, at least with JDK 1.4 this greatly enhances=20 the possibilities for debugging. Unfortunately I don't know wether this is=20 in conformance with the ODMG specification. Johns second item shouldn't be forgotten as well. regards Joachim Sauer |