Package de.xima.fc.dao.interfaces
Interface IFormRecordLockDao
- All Superinterfaces:
de.xima.cmn.dao.interfaces.IAbstractDao<FormRecordLock,,Long, IEntityContext> IGenericDao<FormRecordLock>
- All Known Implementing Classes:
FormRecordLockDao
Data access object for creating, updating, and deleting
WorkflowTask entities.- Since:
- 7.0.0
- Author:
- XIMA MEDIA GmbH
-
Method Summary
Modifier and TypeMethodDescriptionbooleanacquireLock(IEntityContext ec, long formRecordId) Attempts to acquire a lock on theVorgangwith the given ID.getLockDate(IEntityContext ec, long formRecordId) Checks whether the form record with the given ID is locked, and if so, returns the date when it was locked.booleanreleaseLock(IEntityContext ec, long formRecordId) Releases the lock that was acquired byacquireLock(IEntityContext, long).Methods inherited from interface de.xima.cmn.dao.interfaces.IAbstractDao
all, bulkDelete, bulkUpdate, checkLockingVersion, create, create, delete, delete, deleteAll, executePagedDaoAction, getAttributes, getAttributes, getSingleAttributes, getSingleAttributes, getTransactionHandler, read, registerListener, registerListener, registerListener, resultTotalCount, setTransactionHandler, singleElement, unregisterListener, unregisterListener, unregisterListener, update, updateMethods inherited from interface de.xima.fc.dao.interfaces.IGenericDao
count, findAll, findSingle, getEntityRefs, read
-
Method Details
-
acquireLock
Attempts to acquire a lock on theVorgangwith the given ID. A call to this method must be accompanied by a matching call toreleaseLockonce you are done with the form record.Used for example by workflow processing, to make sure that only one thread is execution a workflow task.- Parameters:
ec- Entity context to use to access the database.formRecordId- ID of the form record to lock.- Returns:
trueif the form record was locked, orfalseotherwise. Only when this shouldtrueshould a thread proceed to process the form record.
-
getLockDate
Checks whether the form record with the given ID is locked, and if so, returns the date when it was locked. This is meant only for preliminary or UI checks -- always useacquireLock(IEntityContext, long)andreleaseLock(IEntityContext, long)when you need to actually lock a form record.- Parameters:
ec- Entity context to use to access the database.formRecordId- ID of the form record to unlock.- Returns:
nullwhen the form record is not locked. Otherwise, the date when the form record was locked.
-
releaseLock
Releases the lock that was acquired byacquireLock(IEntityContext, long).- Parameters:
ec- Entity context to use to access the database.formRecordId- ID of the form record to unlock.- Returns:
trueif the form record was locked and was released,falseif the form record was not locked.
-