following question has been posted in this forum, butI can not understand the sentance "The bean cannot recover from this checked exception", does it mean the exception has been handled by container? if so, the container rolls transaction back and throws an EJBException, that is to say no given options are proper for this question. do you think so?
EJB business method performs an operation that
throws a checked exception. The bean cannot recover from this checked exception and should rollback. The bean will be deployed using
container-managed transaction demarcation. Which
implementation is the BEST?
A. public void businessMethod() { try { // operation
throwing
SomeCheckedException goes here }
catch (SomeCheckedException ae) { throw new
EJBException(ae); } }
B. public void businessMethod() { try { // operation
throwing
SomeCheckedException goes here }
catch (SomeCheckedException ae) {
context.setRollbackOnly(); throw
new EJBException(ae); } }
C. public void businessMethod() throws EJBException
{ try { //
operation throwing
SomeCheckedException goes here } catch
(SomeCheckedException ae) {
throw new EJBException(ae); }
}
D. public void businessMethod() throws EJBException
{ try { //
operation throwing
SomeCheckedException goes here } catch
(SomeCheckedException ae) {
context.setRollbackOnly();
throw new EJBException(ae); } } }}