Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

'True' Singletons in Clustered EJB Servers

 
Andy Bowes
Ranch Hand
Posts: 171
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Guys,
Hoping that someone out there can help as I have hit a bit of a conceptual brick-wall
I am currently designing part of an application that will generate and send a batch of emails overnight. This process will be invoked by calling methods on a Stateless Session Bean from a 'Scheduler' task.
The interesting part is that this will need to be deployed in a clustered environment with multiple servers and multiple JVMs on each server. It is therefore vital that there is only ONE scheduler task running in the cluster so that the users don't receive multiple emails (i.e. one per JVM) however it must be resilient so that if any of the servers go down then the scheduler will automatically switch to another server.
The solution must run on a generic EJB1.1 platform.
Thanks in advance for any ideas
Andy Bowes
 
Hari babu
Ranch Hand
Posts: 208
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I feel u should access the scheduler object using a JNDI rather than directly calling the object.
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JMS might be an interesting approach, too. Underlying queue managers usually offer "persistent queues" or "assured delivery" that solve some problems with your singleton server availability. If the singleton is down, requests stay in queue until it comes back.
Could the singleton be in its own application that is not duplicated across the cluster?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic