About Question enthuware.oce-jpad.v6.2.394 :
Posted: Sat Oct 06, 2012 11:48 am
Hi,
I believe the explanation is confusing (or misunderstood by me).
As far as I understand, discarding instances only happens if their method throws an exception (that is not an application exception).
In this case 'The bean A instance will be discarded' will only be true if mA() throws the javax.ejb.EJBTransactionRequiredException. If there would be a catch inside the mA() for that exception and the exception would not be propagated further, bean A instance will not be discarded. So 'gettting' an exception is not enough for an instance to be discarded.
Similar situation is at question 381, where I believe the answer 'The A instance will NOT be discarded' should be true. If the bean A will not throw the exception, it will not be discarded (or the explanation should be changed, because receiving an exception is not enough for discarding the instance). In this question 'encounters' should be replaced with 'throws' in assignment.
(Sorry for not putting the 381 question to its own topic, but I wanted to have it on one place as I think they are related)
I believe the explanation is confusing (or misunderstood by me).
As far as I understand, discarding instances only happens if their method throws an exception (that is not an application exception).
In this case 'The bean A instance will be discarded' will only be true if mA() throws the javax.ejb.EJBTransactionRequiredException. If there would be a catch inside the mA() for that exception and the exception would not be propagated further, bean A instance will not be discarded. So 'gettting' an exception is not enough for an instance to be discarded.
Similar situation is at question 381, where I believe the answer 'The A instance will NOT be discarded' should be true. If the bean A will not throw the exception, it will not be discarded (or the explanation should be changed, because receiving an exception is not enough for discarding the instance). In this question 'encounters' should be replaced with 'throws' in assignment.
(Sorry for not putting the 381 question to its own topic, but I wanted to have it on one place as I think they are related)