A transaction in a database refers to a query being executed and making changes to the data in the database.
Where there are multiple users of a database it is possible for two users to be attempting to edit the same record at the same time. If this was the case, then one user would overwrite the other user’s changes, potentially causing issues with the recording of transactions against the records.
Transactional databases look to negate these issues by adding in additional functionality that reduces the risk of overwriting data when there are multiple concurrent users.
Within a transactional database, a transaction can be in several different states. This is shown below in the state transition diagram (FSM – finite state machine). When a transaction begins it is identified as ‘active’. As the record is selected to be edited it moves into the ‘in progress’ state. Once the query is submitted to the database the transaction can transition to one of three finish states: failed, committed, or aborted.