Page 1 of 1

Re: About Question enthuware.oce-ejbd.v6.2.485 :

Posted: Mon Apr 25, 2011 5:04 pm
by Guest
first i was only thinking about the x==0 part, where it is not specified which param value the method is called with and i guess you where about to write true instead.

now i also think that you should specify that this ia about a local bean, if im not wrong only local beans throw EJBTransactionRolledbackException while remote beans throw TransactionRolledbackException???

Re: About Question enthuware.oce-ejbd.v6.2.485 :

Posted: Mon Apr 25, 2011 8:06 pm
by admin
You are right, the question needs to specify that x = 0.

It is not necessary to specify that it is a local bean because javax.transaction.TransactionRolledbackException is not in any of the options and "None of these" is also not among the options. Further, javax.transaction.TransactionRolledbackException is thrown only if the remote interface extends java.rmi.Remote, which is a special case because, since EJB 3.x, implementing java.rmi.Remote has been out of practice.

Re: About Question enthuware.oce-ejbd.v6.2.485 :

Posted: Tue May 06, 2014 7:41 pm
by renatumb
How about

"The transaction may or may not be rolled back depending on values in deployment descriptor or annotations."

If the exception is a System Exception but its descriptor has a <application-exception> so it will become a Aplication Exception, also if its descriptor has a <rollback>false</rollback>, the transaction will not be rolled back.

Therefore 5th option may be correct too, or not ?

Re: About Question enthuware.oce-ejbd.v6.2.485 :

Posted: Tue May 06, 2014 8:21 pm
by admin
No, because the code shows that it throws EJBException and not some other exception that might be annotated with anything.

Re: About Question enthuware.oce-ejbd.v6.2.485 :

Posted: Tue Aug 12, 2014 1:02 am
by amaebi
Will bean1 also be discarded in addition to bean 2 being discarded?

Re: About Question enthuware.oce-ejbd.v6.2.485 :

Posted: Tue Aug 12, 2014 2:45 am
by admin
No, based on the given information, it cannot be said that bean1 will be or will not be discarded.

Re: About Question enthuware.oce-ejbd.v6.2.485 :

Posted: Tue Aug 12, 2014 11:56 pm
by amaebi
Thanks for the reply. What would prevent bean1 from being discarded since bean1 receives javax.ejb.EJBTransactionRolledbackException because of the call to do2() of Bean2 running within the same transaction and getting an exception.

Similarly to enthuware.oce-ejbd.v6.2.526, "The bean A instance will NOT be discarded" is not a valid answer choice because of explanation "[bean A] will receive a javax.ejb.EJBTransactionRolledbackException which is a system exception because it extends from EJBException. Therefore, the bean instance will be discarded."

Re: About Question enthuware.oce-ejbd.v6.2.485 :

Posted: Wed Aug 13, 2014 12:30 am
by admin
If a bean performs an operation that results in a system exception and if that exception is not handled by the bean and is thrown out to the container, then the bean is discarded.

If a bean A calls another bean B and if the bean B's method throws a system exception, bean B will definitely be discarded but if bean A has the method call in a try/catch block that handles the system exception, there is no reason for bean A to be discarded. But if A's code doesn't catch the exception then that exception will go to the container and then bean A will be discarded as well.

HTH,
Paul.