• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

More Mock Questions

 
Ranch Hand
Posts: 222
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.


=====
Which one of the following tags describe the bean provider's view of a relationship and consists of an optional description, and the name and the class type of a field in the source of a role of a relationship?

1. cmr-field
2. ejb-relation
3. cmr-field-type
4. ejb-redefinition
 
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Question 1
2,4,5
Question 2
ejb-relation
 
Ankit Doshi
Ranch Hand
Posts: 222
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Srividhya,

My guesses were almost similar except option 4 in Q1. This option is not valid as the TransactionRolledbackLocalException is part of javax.ejb and not javax.transaction.

I think I came across these questions on the ejbcertificate and here are the answers with explanation.

Answer to Q1
=================
Answer 5 is correct. javax.transaction.TransactionRolledbackException indicates to a remote client that the transaction has definitely been marked for rollback. Therefore it is pointless for the client to continue with the transaction, as the transaction cannot be committed.

Answers 1 and 2 are incorrect. It is potentially dangerous retrying to continue with a transaction after receiving an application exception because it is not always possible to determine the state of the enterprise bean. For example, if the container started a transaction just before invoking an enterprise bean with container-managed transaction and the enterprise bean throws an application exception and does not mark the transaction for rollback, the container commits the transaction before re-throwing the application exception to the client. In this scenario, it is not possible for the client to continue with the transaction on receiving the application exception.
I am not sure, I am not convinced with this argument

Answer 3 is incorrect. The container will discard the bean instance if a non-application exception is thrown. Answer 4 is incorrect. javax.transaction.TransactionRolledbackException indicates to a local client that the transaction has definitely been marked for rollback. This exception is a subclass of javax.ejb.EJBException.


Answer to Q2
=============
The cmr-field element describes the bean provider's view of a relationship. It consists of an optional description, and the name and the class type of a field in the source of a role of a relationship.
I am not sure about this either. Does spec say something like this?

The ejb-relation element describes a relationship between two entity beans with container-managed persistence.
....
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic