Introduction of Spring Framework transaction management:-
The Sequence of action that will be performed to complete database operation is
called transaction and its management is known as Transaction Management. All
these action in combination will be treated as ONE action only.
Transaction management is an important part of RDBMS oriented enterprise
applications to ensure data integrity and consistency. The concept of
transactions can be described with following four key properties described as
ACID:
1. Atomicity: A transaction should be treated as a single unit of
operation which means either the entire sequence of operations is successful or
unsuccessful.
2. Consistency: This represents the consistency of the referential integrity of the database, unique primary keys in tables etc.
3. Isolation: There may be many transactions processing with the same data set at the same time, each transaction should be isolated from others to prevent data corruption.
4. Durability: Once a transaction has completed, the results of this
transaction have to be made permanent and cannot be erased from the
database due to system failure.
A real RDBMS database system will consider all the four properties for each
transaction. The simple view of a transaction issued to the database using SQL
is following as:
1 Begin the transaction using begin transaction command.
2 Perform various deleted, update or insert operations using SQL
queries.
3 If all the operation are successful then perform commit otherwise
rollback all the operations.