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

Byron's SCEA Preparation Exam: Question #1

 
Byron Estes
Ranch Hand
Posts: 313
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am currently preparing for the SCEA. In order to prepare myself and help others, I will periodically post questions for discussion.
I will post the question and the answer with an explanation separately.
I�d like to get feedback on the correctness of my answer/explanation and constructive criticism to make the question better.
I�ll take your feedback and update the question/answer and aggregate them into an exam, which I will later share with the group.
Byron Estes

Question #1
Changing the �session-type� bean setting in the deployment descriptor can change a session bean from stateful to stateless. What else may need to be changed for a stateful session bean to become a valid stateless session bean?
a)ejbPostCreate methods
b)ejbCreate methods
c)ejbRemove method
d)ejbActivate method
e)ejbPassivate method
 
Byron Estes
Ranch Hand
Posts: 313
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The DRAFT answer with explanation...

The answer is �B�. If the stateful session bean has ejbCreate methods other than the default/empty ejbCreate() method, those methods would need to be removed. If the stateful session bean did not have a default/empty ejbCreate() method, then one would need to be added.
Answer �A� is incorrect because ejbPostCreate() is a callback method for entity beans, not session beans.
Answer �C� is incorrect because ejbRemove() can remain unchanged for a stateful or stateless session bean. It is immaterial.
Answer �D� is incorrect. While ejbActivate() is only pertinent to a stateful session bean (i.e. which needs to preserve conversational state), leaving the method in the bean class will not result in any validation errors.
Answer �E� is incorrect. While ejbPassivate() is only pertinent to a stateful session bean (i.e. which needs to preserve conversational state), leaving the method in the bean class will not result in any validation errors.
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!