This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Five Lines of Code and have Christian Clausen on-line!
See this thread for details.
Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Exception

 
Ranch Hand
Posts: 389
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 219
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
ravi janap
Ranch Hand
Posts: 389
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 389
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
javax.transaction.TransactionRolledbackException is a subclass of java.rmi.RemoteException so 5 is correct.
 
The only thing that kept the leeches off of me was this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic