News:

GinGly.com - Used by 85,000 Members - SMS Backed up 7,35,000 - Contacts Stored  28,850 !!

Main Menu

Database Transactions in JAVA

Started by Kalyan, Aug 26, 2008, 08:06 PM

Previous topic - Next topic

Kalyan

Database Transactions in JAVA

A Database Transaction starts with a query and ends with a 'Commit' (or) 'Rollback'.

Transaction is a unit of work with access to multiple resources

Required Properties

Atomicity of transaction

Data to remain Consistent at the end of a transaction

Isolation of concurrent transactions

Durability of a transaction

A Transaction must be 'Atomic' i.e., it should be treated as a single unit.

All the statements in the Transaction should be either committed (or) rollbacked.  But not individual statements of the Transaction.

A Transaction must be 'Consistent' i.e., individual pieces of same data should be consistent with each other.
Changes made in table [Dept No. in Dept] should reflect in all its supportive tables [Dept No. in Emp table].

Update  emp set dept no. = :  new. detpno Where deptno = : old.deptno;

A Transaction must be 'Isolated' i.e. every Transaction should be independent.  It should not depend on other transactions.

A Transaction must be 'Durable' i.e., every Transaction should be ensured by a 'Commit' (or) 'Rollback'.