wood burning stoves 2.0*
The moose likes EJB and other Java EE Technologies and the fly likes How to control jobs in a clustered environment? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "How to control jobs in a clustered environment?" Watch "How to control jobs in a clustered environment?" New topic
Author

How to control jobs in a clustered environment?

Laxmi Raghu
Ranch Hand

Joined: Feb 16, 2005
Posts: 218
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

Joined: Sep 29, 2002
Posts: 1683
Clustering is used for high availability and failover. Why do you not wish your EJB to have these?


SCJP 1.4, SCWCD 1.3, SCBCD 1.3
Laxmi Raghu
Ranch Hand

Joined: Feb 16, 2005
Posts: 218
It's a clusted environment. We are using clusters.
akilan irudaya raja
Greenhorn

Joined: Feb 19, 2004
Posts: 26
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


Java Programmar SCJP,SCWCD,SCBCD.
Laxmi Raghu
Ranch Hand

Joined: Feb 16, 2005
Posts: 218
Thanks akilan for the info.
Laxmi Raghu
Ranch Hand

Joined: Feb 16, 2005
Posts: 218
Pls Can anybody answer my second question? TIA.
akilan irudaya raja
Greenhorn

Joined: Feb 19, 2004
Posts: 26
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

Joined: Feb 16, 2005
Posts: 218
Thanks again for the info!! It helped me.
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8919

EJBTimer class can also be used.


Groovy
Laxmi Raghu
Ranch Hand

Joined: Feb 16, 2005
Posts: 218
Thank you for the info.
 
 
subject: How to control jobs in a clustered environment?