This week's book giveaway is in the Python forum.
We're giving away four copies of High Performance Python for Data Analytics and have Tiago Rodrigues Antao on-line!
See this thread for details.
Win a copy of High Performance Python for Data Analytics this week in the Python 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
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Jj Roberts
  • Carey Brown
Bartenders:
  • salvin francis
  • Frits Walraven
  • Piet Souris

question from ejbcertificate

 
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"If a remote client in a transaction context invokes a business method on a bean with container-managed transaction, the client receives ______ if the bean instance throws a non-application exception? [Enter exception including its package name]"

requested answer is javax.transaction.TransactionRolledBackException

according to 18.3.1 of the specification, the client will only recieve
a javax.transaction.TransactionRolledBackException (or
javax.ejb.TransactionRolledBackLocalExcpetion) if the bean method executes in the
context of the callers transaction (this provides additional information to
the client that their transaction is doomed).

since the tranactional attribute of the bean method in this question is
unclear (it could be REQUIRESNEW which would not run in the context of
the callers transaction), and since
javax.transaction.TransactionRolledBackException extends from javax.rmi.RemoteException, I think the more
correct answer to this quiestion would be:
javax.rmi.RemoteException.

I think that in order to answer that the client recieves a
TransactionRolledBackException, there should be clear indication to the fact that
the bean method will run in the context of the callers transaction and
explicitly not in its own transaction.

hopefully sun's exam question/answers don't model this one.
 
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Mark,

You are correct. The question is ambiguous. Question must clarify about transaction context of Bean method as either of following:
1] Bean method runs in context of the caller�s transaction
2] Bean method runs in context of a transaction that the Container started immediately before dispatching the business method.
3] Bean method runs with an unspecified transaction context.


The exception thrown by Container would differ based on the above mentioned. Client would receive javax.transaction.TransactionRolledBackException, if business method has transaction attribute as either Required, Mandatory, and Supports in this case.

So what transaction attribute is specified for business method on a bean must have been specified in question.

Rest assured. Actual Certification test would not have such ambiguous questions as per my past experience.
 
Why should I lose weight? They make bigger overalls. And they sure don't make overalls for tiny ads:
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic