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

Query using Timer Service and Entity/Entity Beans

Graeme Jenkinson
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I have a small confusion surrounding the following question from the JavaBeat SCBCD 5.0 Mock Exam:

7) Imagine that the Application you develop periodically sends some events to some other parts of the Application at some defined intervals. Which of the following enterprise bean(s) can be used in this scenario?

1. Entity Bean
2. Stateful Session Bean
3. Stateless Session Bean
4. Message Driven Bean
5. Timer Bean
6. None of the above.

From memory I felt that 1, 3, and 4 were correct, however, the stated answer is that only 3 and 4 are correct. Firstly, I am right is interpretting this question as looking for the understanding of where a Timer can be created? If so, I think that answer is wrong. Trawling my memory banks I clearly remembered a statement in O'Reilly EJB 3.0 book that stated Entity Beans can create timers. After a quick scan I found the following (p48):

Timers can be set on entity, stateless session, and message beans.

To further inestigate this I looked at the EJB 3.0 spec which clearly states that a EJB 3.0 Entity can not create a Timer whereas a EJB 2.x Entity Bean can.

Am I right in thinking that the correct use of the term Entity Bean is to refer to a EJB 2.x Entity Bean (managed by the container and thus able to create a Timer) and that the term Entity refers to a EJB 3.0 Entity (not managed by the container and thus unable to create a Timer)? If so then am I right is saying that answer to the JavaBeat question is wrong? (I'm fairly new to EJB 3.0 and the exam and its objectives so be kind!)


Amandeep Singh
Ranch Hand
Posts: 850
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i think you are right in your fact, they should mention in their question whether they are referring to EJB 2.X Entity Bean .

Because in EJB 3.0, there is no such concept of Entity Beans.

One Clue you can have is whether this exam is for EJB 3.0 or EJB 2.1.

If the exam is for EJB 3.0, just ignore the Entity Beans.
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
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!