my dog learned polymorphism*
The moose likes Architect Certification (SCEA/OCMJEA) and the fly likes EJB TimerService and Part 2 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Architect Certification (SCEA/OCMJEA)
Bookmark "EJB TimerService and Part 2" Watch "EJB TimerService and Part 2" New topic
Author

EJB TimerService and Part 2

Kumar Amit
Ranch Hand

Joined: Aug 13, 2001
Posts: 103
Hi Friends,
How to decide EJB TimerService should be used to solve a problem in the assignment? What are your thoughts?


SCJP, SCJD, SCEA
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30957
    
158

Do you need a timer? This isn't something someone on the internet is likely to be able to tell you.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Kumar Amit
Ranch Hand

Joined: Aug 13, 2001
Posts: 103
Jeanne,
My question is NOT about whether I need a timer. My question is more generic i.e. when to use and when not to use EJB timers and one should look for other schedulers e.g. Quartz. For example
EJB Timer Services is not recommended to use for building real-time applications (mission critical applications), as the expiration may not happen accurately at all times because of certain factors like the network latency, underlying implementation etc.
Youssef Ben Kaddour El Wazzani
Ranch Hand

Joined: Feb 20, 2011
Posts: 41
Hello,

Kumar Amit wrote:EJB Timer Services is not recommended to use for building real-time applications (mission critical applications), as the expiration may not happen accurately at all times because of certain factors like the network latency, underlying implementation etc.


For a banking application you are probably right, but for something like room reservations, a simple timer which will change the rooms status to free if the reservation is not confirmed should be enough.
I mention the reservations example because i remember seen it in the "Maning EJB 3" book, it's seemed reasonable, so as you sayed, it's depend on your assignement and where do you categorate it, is it need a more robust scheduling or not.
Kumar Amit
Ranch Hand

Joined: Aug 13, 2001
Posts: 103
Thanks Youssef. I agree with you that in the example you gave its probably ok to use EJB3 timer.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: EJB TimerService and Part 2