public class Locker extends JdbcFacade implements HasTransactionAttribute
CREATE TABLE <schema_owner>.IBISLOCK ( OBJECTID VARCHAR2(100 CHAR), TYPE CHAR(1 CHAR), HOST VARCHAR2(100 CHAR), CREATIONDATE TIMESTAMP(6), EXPIRYDATE TIMESTAMP(6) CONSTRAINT PK_IBISLOCK PRIMARY KEY (OBJECTID) ); CREATE INDEX <schema_owner>.IX_IBISLOCK ON <schema_owner>.IBISLOCK (EXPIRYDATE); GRANT DELETE, INSERT, SELECT, UPDATE ON <schema_owner>.IBISLOCK TO <rolename>; GRANT SELECT ON SYS.DBA_PENDING_TRANSACTIONS TO <rolename>; COMMIT;
Modifier and Type | Class and Description |
---|---|
static class |
Locker.LockType |
HasStatistics.Action
Constructor and Description |
---|
Locker() |
Modifier and Type | Method and Description |
---|---|
String |
acquire() |
String |
acquire(MessageKeeper messageKeeper)
Obtain the lock.
|
void |
configure() |
String |
getLockerInfo(String objectIdWithSuffix) |
protected String |
getLogPrefix() |
void |
release(String objectIdWithSuffix) |
void |
setDateFormatSuffix(String dateFormatSuffix)
Format for date which is added after
objectid (e.g. |
void |
setFirstDelay(int firstDelay)
The time in ms to wait before the first attempt to acquire a lock is made
|
void |
setIgnoreTableNotExist(boolean b)
If set
true and the IBISLOCK table does not exist in the database, the process continues as if the lock was obtained |
void |
setLockWaitTimeout(int i)
If > 0: The time in s to wait before the INSERT statement to obtain the lock is canceled.
|
void |
setNumRetries(int numRetries)
The number of times an attempt should be made to acquire a lock, after this many times an exception is thrown when no lock could be acquired, when -1 the number of retries is unlimited
|
void |
setObjectId(String objectId)
Identifier for this lock
|
void |
setRetention(int retention)
The time (for type=P in days and for type=T in hours) to keep the record in the database before making it eligible for deletion by a cleanup process
|
void |
setRetryDelay(int retryDelay)
The time in ms to wait before another attempt to acquire a lock is made
|
void |
setType(Locker.LockType type)
Type for this lock: P(ermanent) or T(emporary).
|
String |
toString() |
getAuthAlias, getConnection, getConnectionWithTimeout, getDatasource, getDatasourceInfo, getDatasourceName, getDbmsSupport, getPassword, getPhysicalDestinationName, getUsername, isConnectionsArePooled, isTransacted, iterateOverStatistics, setAuthAlias, setConnectionsArePooled, setDatasourceName, setDbmsSupportFactory, setJmsRealm, setPassword, setTransacted, setUsername
close, getContext, getJndiEnv, setAuthentication, setCredentials, setInitialContextFactoryName, setJndiAuthAlias, setJndiContextPrefix, setJndiProperties, setName, setPrincipal, setProviderURL, setSecurityProtocol, setUrlPkgPrefixes
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getTransactionAttribute, getTransactionTimeout, getTxDef, setTransactionAttribute, setTransactionTimeout
getDomain
getName
getApplicationContext, getName
getConfigurationClassLoader
public void configure() throws ConfigurationException
configure
in interface IConfigurable
configure
in class JdbcFacade
ConfigurationException
public String acquire() throws JdbcException, SQLException, InterruptedException
public String acquire(MessageKeeper messageKeeper) throws JdbcException, SQLException, InterruptedException
public void release(String objectIdWithSuffix) throws JdbcException, SQLException
JdbcException
SQLException
protected String getLogPrefix()
getLogPrefix
in class JdbcFacade
@Mandatory public void setObjectId(String objectId)
public void setType(Locker.LockType type)
public void setDateFormatSuffix(String dateFormatSuffix)
objectid
(e.g. yyyyMMdd to be sure the job is executed only once a day)public void setRetention(int retention)
public void setNumRetries(int numRetries)
public void setFirstDelay(int firstDelay)
public void setRetryDelay(int retryDelay)
public void setLockWaitTimeout(int i)
public void setIgnoreTableNotExist(boolean b)
true
and the IBISLOCK table does not exist in the database, the process continues as if the lock was obtainedCopyright © 2023 Frank!Framework. All rights reserved.