[OJB-developers] PersistenceBrokerException
Brought to you by:
thma
From: Darren S. <Dar...@cw...> - 2002-01-25 14:01:27
|
Hi, I've just generated a test case in our own code which lead to a failure in generating a new sequence id. No problem with this except I seem to be losing exception information as the exception is thrown from ClassDescriptor out through the PersistenceBroker. PersistenceBrokerException seems to store the exception reason in a field calls 'msg' along with a reference to the nested exception. However calling getMessage on a base class of PersistenceBrokerException does not return this error - since it will use the Throwable implementation. Now this may or may not be what was intended - this does however cause problems where PersistenceBrokerExceptions are caught and translated, especially where we see code such as: catch(Throwable e) { throw new MyException(e.getMessage()); } This type of translation actually occurs within the sequence generation stack: ClassDescriptor.getKeyValues() throws PersistenceBrokerException Identify() catches Throwable and translates to ClassNotPersistenceCapable using t.getMessage. In this scenario the PersistenceBrokerException which is thrown out of the broker.store does not contain the original error details in the message. PersistenceBrokerException also doesn't provide a mechanism for retrieving the 'source' exception. Kind of leads me to think it was an initial implementation or I'm missing the intent. Regards Darren ****************************************************************************************************************************************************** This e-mail has been prepared using information believed by the author to be reliable and accurate, but Thales Information Systems Finance makes no warranty as to accuracy or completeness. In particular Thales Information Systems Finance does not accept responsibility for changes made to this e-mail after it was sent. Any opinions expressed in this document are those of the author and do not necessarily reflect the opinions of the company or its affiliates. They may be subject to change without notice. This e-mail, its content and any files transmitted with it are intended solely for the addressee(s) and may be legally privileged and/or confidential. Access by any other party is unauthorised without the express written permission of the sender. If you have received this e-mail in error you may not copy or use the contents, attachments or information in any way. Please destroy it and contact the sender via the Thales Information Systems Finance switchboard in London at +44 (0) 20 7650 0100 or via e-mail return. This message and any attachments have been scanned for viruses prior to leaving the originators network. The originator does not guarantee the security of this message and will not be responsible for any damages arising from any alteration of this message by a third party or as a result of any virus being passed on. ******************************************************************************************************************************************************* |