This function makes 2 things: it creates an entry in table BATCHRUNS and directly checks, if no other instance of the given batchType is running ( finished is null).
Syntax
long
getLock
(
final int
batchType
,
final int
maxAgeInSeconds
,
final long
callerId
) throws LockingException
Parameters
-
batchType –
Batch type as existing in MOB_BATCHRUN_TYPES
-
maxAgeInSeconds –
The maxAgeInSeconds specifies after which time an old, unfinished BatchRun is ignored
-
callerId –
The ID of the caller of the service.
Exceptions
-
LockingException class –
is thrown in case the lock can not be obtained (another instance is already running).
Usage
The maxAgeInSeconds specifies after which time an old, unfinished BatchRun is ignored. The function
releaseLock
has to be called to release the lock.