What is the best way to handle exception in MDBs? They should be caught and thrown as RemoteException ? they should be caught and thrown as EJBException? or they should be handled somehow in the bean code itself ? Or there is any other way to handle exceptions in case of MDBs? regards ashish sarin scjp,scjd,scwcd,scbcd,scea(part i),ibm-xml
RemoteException does not make sense since there is no remote client. If you cannot handle an Exception, then spec suggests that an EJBException be thrown.
If it is an Exception that the client really is concerned about, the MDB can catch the exception and perhaps put some message on another queue that the client can listen to. If a message appears on the "Error" queue, than it can get some ID out of the message so it can somehow relate it to the original message and get the error. Of course good logging is very helpful too. Brian