Batch jobs - prevent concurrency
I have several batch jobs running on a SAP Java system using SAP Java
Scheduler. Unfortunately, I haven't come across any documentation that
shows how to prevent concurrent executions for periodic jobs. All I've
seen is "a new instance of the job will be executed at the next interval".
This ruins my fi-fo processing logic so I need to find a way to prevent
it. If the scheduler API had a way of checking for the same job
executions, this would be solved but haven't seen an example yet.
As a general architectural approach, other means to do this seems like
using a DB table - an indicator table for marking current executions - or
a JNDI parameter which would be checked first when the job starts. I could
also "attempt" to use a static integer but that would fail me on clustered
instances. The system is J2EE5 compliant and supports EJB 3.0, so a
"singleton EJB" is not available either. I could set the max pool size for
a bean and achieve a similar result maybe.
I'd like to hear your opinions on how to achieve this goal using different
architectures.
Kind Regards,
S. Gökhan Topçu
No comments:
Post a Comment