J2EE ACID Transaction Sample
Posted on 2014-03-10
I had a query "How J2EE manage transaction?" same as RDBMS ACID (Atomicity, Consistency, Isolation, Durability) engine.
Someone replied on how J2ee transactions are managed to make sure they are successful or failed by giving following example.
Money taken out of account A (Debit) and added to account B (credit). This process should either complete else fail.
Solution is implemented in 2 stages-
1. Record move money going out from account of A
2. Record money moving into account of B
3. When transaction is complete , both accounts (A,B) are notified that operation is complete.
4. If any issues observed both accounts are rolled back
Is this right and can someone share a J2EE code samples to integrate it for my app?