• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to control jobs in a clustered environment?

 
Laxmi Raghu
Ranch Hand
Posts: 218
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have two questions. Can we write jobs in EJB? I mean the one like cron jobs in Unix.If so, how? I'm using web logic as application server.

Second question is: I've a job that runs every 5 seconds. It's written as a EJB. And it's available in a clustered environment.

I would like to know how can we avoid running the same job on multiple servers in a clustered environment? I mean, if job is running on one server, it should not run on other servers in a clustered environment.
 
Roger Chung-Wee
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Clustering is used for high availability and failover. Why do you not wish your EJB to have these?
 
Laxmi Raghu
Ranch Hand
Posts: 218
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's a clusted environment. We are using clusters.
 
akilan irudaya raja
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I don't think u cannot use EJB as crown job.
Use quartz [ http://www.opensymphony.com/quartz/ ] as scheduler.
It can trigger EJB for any business.

HTH,
Akilan
 
Laxmi Raghu
Ranch Hand
Posts: 218
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks akilan for the info.
 
Laxmi Raghu
Ranch Hand
Posts: 218
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Pls Can anybody answer my second question? TIA.
 
akilan irudaya raja
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

My suggestion would be , have a DB entry ,whenever job runs.
DB will be common for the all the cluster instances.

HTH,
Akilan
 
Laxmi Raghu
Ranch Hand
Posts: 218
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks again for the info!! It helped me.
 
Pradeep bhatt
Ranch Hand
Posts: 8927
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
EJBTimer class can also be used.
 
Laxmi Raghu
Ranch Hand
Posts: 218
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for the info.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic