Refer to the EJB 2.1 specs sec 15.4.13 (there will be something similar in
the older specs too) ...

"Message-driven beans should not, in general, throw RuntimeExceptions...."

In case of an MDB using bean managed tx, the container will not acknowldege
the message in case of a RuntimeException and hence the message will be
redelivered. If you handle the exception in the onMessage, the container
will duly acknowledge the message.

-Saurabh

----- Original Message -----
From: "Sachin Pandey" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, September 26, 2002 11:38 AM
Subject: Handling RuntimeExceptions in MDB


Hi,

     I want to know what's the best way of handling RuntimeExceptions in
Message Driven Beans. Currently I have an MDB listening to a Queue. The
acknowledgement mode is set to AUTO_ACKNOWLEDGE. If the onMessage() throws a
RuntimeException will the app server retry the delivery of the message. I
guess that's what is happening currently with my application. If I catch the
base class Exception it works fine. I am not sure if this is the right way
to do it though?

Using JBoss 2.4.4 (JBossMQ).
Thanks for any suggestions.

Sachin Pandey
NUIX Pty Ltd
Level 8, 143 York Street,
Sydney 2000
Phone: (02) 92839010
Fax: (02) 92839020

Disclaimer:
This message is intended only for the named recipient. If you are not the
intended recipient you are notified that disclosing,copying, distributing or
taking any action in reliance on the contents of this information is
strictly prohibited.

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to