wood burning stoves 2.0*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Exception" Watch "Exception" New topic
Author

Exception

ravi janap
Ranch Hand

Joined: Nov 04, 2000
Posts: 389
Hi

This is a question from ejbcertificate.com.

Answer mentions that only 5 is the right answer. 4 is similar to 5 the only difference being that 4 is for a local client and 5 is for a remote client.
Why 4 is not right?

Which one of the following statements regarding the client view of exceptions received from an enterprise bean invocation is correct?

1. The client can safely continue the transaction by retrying the operation if an application exception is received.

2. The client can safely continue the transaction by retrying the operation if an application exception is received, but only after checking the transaction has not been marked for rollback.

3. The client can safely continue the transaction by retrying the operation if a non-application exception is received.

4. A local client cannot continue a transaction if javax.transaction.TransactionRolledbackLocalException is received.

5. A remote client cannot continue a transaction if javax.transaction.TransactionRolledbackException is received.

Thanks

Ravi


SCJP, SCJD, SCWCD, SCBCD, SCEA
Thiru Thangavelu
Ranch Hand

Joined: Aug 29, 2001
Posts: 219
Answers are below.

1. The client can safely continue the transaction by retrying the operation if an application exception is received.

-- TRUE

2. The client can safely continue the transaction by retrying the operation if an application exception is received, but only after checking the transaction has not been marked for rollback.

-- TRUE

3. The client can safely continue the transaction by retrying the operation if a non-application exception is received.

-- FALSE

4. A local client cannot continue a transaction if javax.transaction.TransactionRolledbackLocalException is received.

-- TRUE (the transaction meant to rollback or already rolled back. So continuing the transaction is fruitless)

5. A remote client cannot continue a transaction if javax.transaction.TransactionRolledbackException is received.

-- TRUE (Explanation same as above)

Ranchers correct me if i am wrong.


Thanks,<br />Thiru<br />[SCJP,SCWCD,SCBCD]
ravi janap
Ranch Hand

Joined: Nov 04, 2000
Posts: 389
Hi

Is the package structure correct in 4 & 5?

For Local Client it should be javax.ejb.TransactionRolledbackLocalException

For Remote Client it should be java.rmi.TransactionRolledbackException

This is according to HFE page # 551.

-- Ravi
ravi janap
Ranch Hand

Joined: Nov 04, 2000
Posts: 389
javax.transaction.TransactionRolledbackException is a subclass of java.rmi.RemoteException so 5 is correct.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Exception