Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Mandatory

 
amol deshpande
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
if we call a method(in bean A) with mandatory attribute, from another bean (bean B) Which bean will get TransactionRequiredException/local?
Bean B or bean A?
Amol
 
Keerthi P
Ranch Hand
Posts: 204
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The 'caller' will get the exception.
 
Gian Franco
blacksmith
Ranch Hand
Posts: 979
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

From the specs (18.4.2.2)

The javax.transaction.TransactionRequiredException is a
subclass of the java.rmi.RemoteException. It is defined
in the JTA standard extension.
The javax.ejb.TransactionRequiredLocalException is a
subclass of the javax.ejb.EJBException.

The javax.transaction.TransactionRequiredException or
javax.ejb.TransactionRequiredLocalException informs the
client that the target enterprise bean must be invoked
in a client�s transaction, and that the client invoked
the enterprise bean without a transaction context.

This error usually indicates that the application was not
properly formed.


Cheers,

Gian
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!