• Post Reply Bookmark Topic Watch Topic
  • New Topic

EJB - Logging

 
kiran mahavir
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
My project is on EJB1.1 which does not have EJBException(String,Exception) constructor.
I want to avoid logging exception at EJB layer. But i need to pass both user friendly message and the exception to the web layer.
for this can i do the following.
create a subclass of EJBException which takes String and Exception as parameters in constructot and let all the bean impl. methods throw this exception instead of EJBException. (The remote interface operations still throw RemoteException).
If i implement the above thing, will transactions behave properly (transaction will be rolledback when an EJBExcption is thrown and other behaviour related to transaction).
Is it enough if the implementation methods contains "throws EJBException" in their signature even thought the catch block throws the subclass of the EJBException?
regards
kiran
 
Dana Hanna
Ranch Hand
Posts: 227
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I believe that you are right on the money. Subclassing this to extend it's behavior is what OOp is all about!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!