Saturday, December 14, 2013

Transaction Models

There are 2 Types of Transaction Models

 1. Flat Transactions.                                                            

 2. Nested Transactions.

A Flat Transaction is One Which Treats all operations of a transaction as one transaction,and if one operations fails then the entire Transaction will be Rolled back.

Transaction{

Operation 1

Operation 2

Operation 3

     .
     .

}

If any one of the above operations failed then the entire transaction will be rolled back.

A Nested Transaction is one which Considers each operation in Transaction as sub Transaction of that Main Transaction.If any one of the Sub Transaction(operation) fails no impact on the Main Transaction.

Main Transaction{

sub transaction 1{
Operation 1
}

sub transaction 2{
Operation 2
}

sub transaction 3{
Operation 3
}

     .
     .

}

If any one of the above sub Transaction failed no Effect on Main Transaction.

NOTE: Spring, EJB and Hibernate Supports Flat Transactions.
       Only Spring supports Nested Transactions.  

0 comments:

Post a Comment