Page 1 of 1

Re: About Question enthuware.oce-jpad.v6.2.403 :

Posted: Sun Dec 25, 2016 1:36 am
by johnlong
An application exception with rollback=true will also produce the same result.
Will client get javax.ejb.EJBTransactionRolledbackException in this case?

Re: About Question enthuware.oce-jpad.v6.2.403 :

Posted: Sun Dec 25, 2016 12:09 pm
by admin
Yes, that is what the problem statement says as well.

Re: About Question enthuware.oce-jpad.v6.2.403 :

Posted: Sun Dec 25, 2016 6:16 pm
by johnlong
Can you advise where it is stated in JBL specifications?
I can see that if AppException is thrown, client will receive get the same AppExcetpion, not javax.ejb.EJBTransactionRolledbackException

Re: About Question enthuware.oce-jpad.v6.2.403 :

Posted: Mon Dec 26, 2016 1:00 am
by admin
This is specified in Section 13. of EJB 3.1 specification (you need to refer to this because transactions are covered in EJB 3.1). I am not quoting the whole section here but read it and look for the following:
...
If the instance executed in the client’s transaction, the container should throw the javax.ejb.EJBTransactionRolledbackException.
...

Re: About Question enthuware.oce-jpad.v6.2.403 :

Posted: Wed Dec 28, 2016 7:57 am
by johnlong
Do you refer to 14.3.7? If yes, it is only applicable in case If the business interface is a remote business interface that extends java.rmi.Remote, the javax.transaction.TransactionRolledbackException is thrown to the client instead.
I did not find this excerpt in Section 13.

Re: About Question enthuware.oce-jpad.v6.2.403 :

Posted: Thu Dec 29, 2016 2:01 am
by admin
Yes, it is 14.3.7. Not sure why I wrote 13. Sorry about that.
So the same result can be produced with an application exception marked with rollback as true. Therefore, this option is not necessarily correct. I agree that the explanation should say, "An application exception with rollback=true may also produce the same result".

-Paul.

Re: About Question enthuware.oce-jpad.v6.2.403 :

Posted: Thu Dec 29, 2016 10:09 am
by johnlong
14.3.7 applies only to the container’s handling of exceptions thrown from the other container-invoked callbacks on the enterprise bean, not to all cases.
Another issue about "An application exception with rollback=true will also produce the same result." is that the same result in terms of transaction rollback - yes, but it won't be same javax.ejb.EJBTransactionRolledbackException, but ApplicationException what client gets. So we can't say that it would be same result. And we can say that application encountered system exception, unless there is a case of exception thrown from the container-invoked callback on the enterprise bean, which is not case here. We are not told that there was a such call.