| |
GeekInterview.com > Interview Questions > J2EE > EJB
| Print | |
Question: What are the various isolation levels in a transaction and differences between them
Answer: Answered by Jey on 2005-05-08 19:35:35: There are three isolation levels in Transaction. They are 1. Dirty reads 2.Non repeatable reads 3. Phantom reads. Dirrty Reads If transaction A updates a record in database followed by the transaction B reading the record then the transaction A performs a rollback on its update operation, the result that transaction B had read is invalid as it has been rolled back by transaction A. NonRepeatable ReadsIf transaction A reads a record, followed by transaction B updating the same record, then transaction A reads the same record a second time, transaction A has read two different values for the same record. Phantom ReadsIf transaction A performs a query on the database with a particular search criteria (WHERE clause), followed by transaction B creating new records that satisfy the search criteria, followed by transaction A repeating its query, transaction A sees new, phantom records in the results of the second query.
|
| February 02, 2006 05:35:38 |
#3 |
| Ahmed |
Member Since: Visitor Total Comments: N/A |
RE: What are the various isolation levels in a transac... |
| Isolation levels are Dirty_Read, Non Repeatable read and phantoms. These are the inconsistancies which are occured in transactions. To avoid these inconsistencies , we have 4 types of attributes.TRANSACTION_READ_UNCOMMITED TRANSACTION_READ_COMMITED=== Avoids dirty read TRANSACTION_REPEATABLE_READ ===Avoids dirty read and Non repeatable read TRANSACTION_SERIALIZABLE=== Avoids dirty read , Non repeatable read and Avoids Phontom reads |
| |
Back To Question | |