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

Mock question regarding methods callable in MDB..

 
saran ram
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which of the following methods can the message driven bean legally call on its context?

The answers were

getUserTransaction
getCallerPrincipal

Calling getUserTransaction() is legal or what?
Please clarify.
 
Vagner Freitas
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Only BMP MDB can call getUserTransaction() in OnMessage() method. CMP MDB can't call.
I think neither of them can call getCallerPrincipal(), because MDB don't have client.
I hope this help.

Vagner
 
saran ram
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you vagnar
 
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!