Algorithms for ensuring the security of receiving and transmitting transaction blocks in blockchain technology


Transaction and transaction states


Download 124.05 Kb.
bet2/5
Sana09.04.2023
Hajmi124.05 Kb.
#1343400
1   2   3   4   5
Bog'liq
Raxmonova V article

Transaction and transaction states
A transaction is a sequence of operations performed on a database that takes it from one consistent state to another. When a database session occurs, a transaction begins. For example, we can bring the bank transfer process. The amount of 100 trillion soums will be transferred from the current account to the card account. The program withdraws the amount from the current account and then adds it to the card account. When the program is running, after making the first change, the power is turned off and the card counter does not increase. To avoid this situation, both teams must make a deal. If all commands in the transaction fail, the transaction is rolled back.
A transaction is considered as an atomic operation, but in reality it goes through a number of states during its lifetime. The transactions boundaries are specified by BEGIN-TRANSACTION and END-TRANSACTION statements. For recovery purpose (in case of data lost), the system needs to keep track of all these states.

Pic.1. Transaction States Diagram

As above image clearly depicts, transaction states are –


BEGIN: The database is in a consistent state before a transaction begins. The transaction on the database begins by the execution of the first statement of the transaction i.e. it becomes active.
ACTIVE: In the active state, the transaction is modifying the database state. That means, a transaction is performing write operations on the database items, At the end of the active (modify) state, the transaction enters into one of the three states: start to commit, abort or error.
COMMIT: In the start-to-commit state, the transaction instructs the DBMS to reflect the Change (made by the transaction) into the database. Once all these changes are done in the database, the transaction is said to be in the commit state.
ROLLBACK: There is a possibility that all the changes made by the transaction are not transmitted to the database due to the hardware or system failures or any errors like dividing by zero. In this case, the transaction enters into the abort or error state and is roll back and ultimately ends the transaction. An aborted transaction that made no changes to the database is terminated (ended) without the need for a rollback.
END: The transaction can be end in three different ways:

Download 124.05 Kb.

Do'stlaringiz bilan baham:
1   2   3   4   5




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling