| |
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.
|
| July 07, 2005 11:58:56 |
#2 |
| J. P. Naidu |
Member Since: Visitor Total Comments: N/A |
RE: What are the various isolation levels in a transaction and differences between them |
TRANSACTION_READ_UNCOMMITED TRANSACTION_READ_COMMITED=== Avoids dirty read TRANSACTION_REPEATABLE_READ ===Avoids Non repeatable re TRANSACTION_SERIALIZABLE=== Avoids Phontom reads |
| |
Back To Question | |