• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Confirmation Required for session bean(Q-SCBCD Exam Kit)Manning Pub

 
Awishek sinha
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. Which of the following methods can be called from the code of a stateless session
bean�s client?
a. ejbCreate()
b. remove()
c. create()
d. ejbRemove()
e. createDiscount()
Answer: B, C

I believe the answer should be b,c,e
as it has been asked about the valid methods from session bean client (can be called using reference of Home & Component interface) so createDiscount can be a business method that can be declared in component interface & its implementation can be in bean class as the spec says
The name of business method in bean class should not begin with ejb(can begin with create)
Let me know your opinion?
 
Sanjeev BhimaRao
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To me the question sounds like, which method can be called from the client of a stateless session bean. Stateless session bean creates cannot have any other name apart from create. Hence, B and C are the right answers.
 
Awishek sinha
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But Can't we have a business method named createDiscount in session bean class as ejb spec can allow me have this named method.(specs says we cannot have business method starting with name ejb..)
 
Amol Nayak
Ranch Hand
Posts: 218
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The question looks like which methods on a Home interface of Stateless session bean.

According to the spec (section 7.11.6) only one create is allowed in
the home of Stateless session bean.



So last one is not a correct answer. Hope that clears your doubt.
 
Awishek sinha
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I too agree if it's using HomeInterface we can call only create() & remove() but question does not say home
Which of the following methods can be called from the code of a stateless session
bean�s client?
(not specified only home interface)
Let me know if i comrehend the question wrong
 
Amol Nayak
Ranch Hand
Posts: 218
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In that case the question is not framed properly, From the methods given it looks like it should be Home interface.
The real exam would not have question where language is not clear.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic