About question enthuware.oce-jpad.v6.2.403
Moderators: Site Manager, fjwalraven
-
- Posts: 3
- Joined: Tue Jul 19, 2011 11:32 am
- Contact:
About question enthuware.oce-jpad.v6.2.403
The question says: "A client of a session bean with container managed transaction demarcation gets a javax.ejb.EJBTransactionRolledbackException."
The answer "The client must have called the method through the bean's local interface." is incorrect according to the exam.
But the explanation says: "However, if the business interface is a remote business interface that extends java.rmi.Remote, the javax.transaction.TransactionrolledbackException is thrown to the clients." that somehow makes the following answer wrong:
"The client may have called the method through the bean's remote or local interface."
Am I right?
The answer "The client must have called the method through the bean's local interface." is incorrect according to the exam.
But the explanation says: "However, if the business interface is a remote business interface that extends java.rmi.Remote, the javax.transaction.TransactionrolledbackException is thrown to the clients." that somehow makes the following answer wrong:
"The client may have called the method through the bean's remote or local interface."
Am I right?
-
- Site Admin
- Posts: 10389
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About question enthuware.oce-jpad.v6.2.403
No, in EJB 3.1, the remote business interface is not required or expected to be a java.rmi.Remote interface. So even if the client has called the bean through its remote interface, it is possible for the client to get EJBTransactionRolledbackException.
Therefore, "The client must have called the method through the bean's local interface" should be wrong.
HTH,
Paul.
Therefore, "The client must have called the method through the bean's local interface" should be wrong.
HTH,
Paul.
Re: About question enthuware.oce-jpad.v6.2.403
I don't understand why in the Javadoc of JEE6 it says:
EJBTransactionRolledbackException - is for remote clients
EJBTransactionRolledbackLocalException - is for local clients
EJBTransactionRolledbackException - is for remote clients
EJBTransactionRolledbackLocalException - is for local clients
-
- Posts: 60
- Joined: Wed Apr 23, 2014 6:38 pm
- Contact:
Re: About question enthuware.oce-jpad.v6.2.403
To clarify, when the answer goes with a more explicit version would be
Please confirm if possible if javax.transaction.TransactionRolledbackException is thrown only to 2.1 clients in this scenario, and javax.ejb.EJBTransactionRolledbackException will be thrown to all 3.0 clients. Thanks.
Code: Select all
However, if the business interface is a remote business interface that extends java.rmi.Remote, javax.transaction.TransactionRolledbackException is thrown to the clients
However, if the business interface is a 2.1 remote business interface that extends java.rmi.Remote, javax.transaction.TransactionRolledbackException is thrown to the clients
Please confirm if possible if javax.transaction.TransactionRolledbackException is thrown only to 2.1 clients in this scenario, and javax.ejb.EJBTransactionRolledbackException will be thrown to all 3.0 clients. Thanks.
-
- Site Admin
- Posts: 10389
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About question enthuware.oce-jpad.v6.2.403
No, I don't think so. In many places, the specification says that TransactionRolledbackException is thrown if the business interface is a remote business interface that extends java.rmi.Remote. For example, in section 14.3.2, table 17, and Section 14.3.7 (last paragraph) refers to Note 79, which says, "If the business interface is a remote business interface that extends java.rmi.Remote, the javax.transaction.TransactionRolledbackException is thrown to the client instead."
So I don't think it is meant for 2.1 only.
-Paul.
So I don't think it is meant for 2.1 only.
-Paul.
-
- Posts: 60
- Joined: Wed Apr 23, 2014 6:38 pm
- Contact:
-
- Posts: 11
- Joined: Fri Jan 23, 2015 5:05 am
- Contact:
Re: About question enthuware.oce-jpad.v6.2.403
If an application exception can also mark a transaction for Rollback via @ApplicationException(rollback=true|false), how can we know if the Exception was an application exception or a system exception? I.e. how can I be sure that it was a system exception, as your exam question evaluation suggests?
-
- Site Admin
- Posts: 10389
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About question enthuware.oce-jpad.v6.2.403
Marking an application exception with rollback=true doesn't make it a system exception. It will still remain an application exception.
-
- Posts: 11
- Joined: Fri Jan 23, 2015 5:05 am
- Contact:
Re: About question enthuware.oce-jpad.v6.2.403
Of course.admin wrote:Marking an application exception with rollback=true doesn't make it a system exception. It will still remain an application exception.
Let me rephrase my question to explain what I'm asking:
In the exam question, you ask
Two of the options you propose as answers areA client of a session bean with container managed transaction demarcation gets a javax.ejb.EJBTransactionRolledbackException. Assuming that the session bean executes within the client's transaction context, and that the transaction was not already rolled back before calling the bean method, which of the following statements are correct?
- The bean method encountered a system exception.
- The bean method encountered an application exception.
- - system exception
- - application exception with @ApplicationException(rollback=true)
Neither answer should be marked as correct then.
-
- Site Admin
- Posts: 10389
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About question enthuware.oce-jpad.v6.2.403
OK, I see what you mean. The options show a possibility. It could be either a system exception or an application exception with rollback=true. You are right, they may be misinterpreted. Fixed.
thank you for your feedback!
Paul.
thank you for your feedback!
Paul.
Who is online
Users browsing this forum: No registered users and 22 guests