Within DOKA a contract is the legal binding base for business.
A transaction represents a step in the business development.
A Contract might be connected to one or more transactions as the creation of a contract typically is done in a transaction. In rare cases like via migrations a contract might be created without a connected transaction.
A look into the contract ERD diagram might help to understand the connection of the different used database table.
Contracts are stored per business sector and have a representation in the business global table CCI where a small subset of data of all contracts in all business sectors are stored.
The locking of entries to prevent concurrent update of the same data is done on contract level for interactive transactions.
Transactions are seen as a read only set of data after creation with the exception of some flags and status information which might be changed after creation to reflect the changing state in the following workflow.
The workflow services lock the transaction and lock the contract only in cases where contract information are to be changed.
A correction (=Changing of any application data element) of a transaction is done by copying the original transaction data into a new instance of the transaction allowing to change any changeable data element, rolling back the original (to be corrected) transaction and by creation of a new transaction.