Facade design
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   avihaimar_marchiano
Posted On:   Monday, January 7, 2008 01:47 PM

Hey, I have SWT client that communicate with the server via facade. The facade layer is a group of stateless session beans. I want to get advices from you about handling exceptions. 1. As I mentioned above the façade is stateless session bean (ejb3) and the transaction is CMT, which means that the transaction is closed and committed after my method ended. The problem with this is that the client gets unclear exceptions like DB vendor exception or hibernate exception in case of commit failure. I want to hear what are you doing? 2. If inner component in the server throw an exception the above layer wrap this exception and throw it to the layer above in case it catch the exception. In the façade I cant w   More>>

Hey,

I have SWT client that communicate with the server via facade.

The facade layer is a group of stateless session beans.

I want to get advices from you about handling exceptions.

1. As I mentioned above the façade is stateless session bean (ejb3) and the transaction is CMT, which means that the transaction is closed and committed after my method ended. The problem with this is that the client gets unclear exceptions like DB vendor exception or hibernate exception in case of commit failure. I want to hear what are you doing?

2. If inner component in the server throw an exception the above layer wrap this exception and throw it to the layer above in case it catch the exception. In the façade I cant wrap the exception I get and throw it to the client, because the client doesn’t know the inner server exception or third-party exception, so it will get class not found.. in order to solve this I have catch(Exception) in the façade that throw new ServerClientException , but in this way I lose a lot of information regarded to the underline reasons to the exception. I be happy to hear your opinion about this.

Thank you

   <<Less

Re: Facade design

Posted By:   Stephen_McConnell  
Posted On:   Tuesday, January 8, 2008 09:54 AM

You can add a lot of information into the ServerClientException in the message and also from the exception that is thrown INSIDE the EJB before you throw it out. But do you want to pass that on to the client. I would figure that the client wants to know as little as possible... Just that there was a problem doing something.


However, if you log on the server side what the exception was, then when the client reports a problem, the administrator or developer can go to the logs and see what the problem was.


Is this what you are interested in doing?

About | Sitemap | Contact