Hello, Recently in one of interview i faced on ejb technology. They have asked me about transaction isolation levels. I have told them about about the security issues like - relamtool -add user & also about ACID properties Isolation property. Can any body tell me what it is? & what are they? Kapil
The isolation level measures concurrent transactions' capacity to view data that have been updated, but not yet committed, by another transaction. ReadUncommitted: Data that have been updated but not yet committed by a transaction may be read by other transactions. ReadCommitted: Only data that have been committed by a transaction can be read by other transactions. RepeatableRead: Only data that have been committed by a transaction can be read by other transactions, and multiple reads will yield the same result as long as the data have not been committed. Serializable: This, the highest possible isolation level, ensures a transaction's exclusive read-write access to data. It includes the conditions of ReadCommitted and RepeatableRead and stipulates that all transactions run serially to achieve maximum data integrity. This yields the slowest performance and least concurrency. The term serializable in this context is absolutely unrelated to Java's object-serialization mechanism and the java.io.Serializable interface.
Isolation level represents how database maintains data integrity due to the problems like dirty reads, non-repeatable reads and phantom reads which can occur due to concurrent transactions. Following four transaction levels are defined in java.sql.Connection interface: TRANSACTION_READ_COMMITTED, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE. Setting the isolation level has an impact on performance. TRANSACTION_READ_UNCOMMITED is having Fastest performance but permits dirty reads, non repeatable reads and phantom reads. Whereas TRANSACTION_SERIALIZABLE is the Slowest but secures you from all the above three. Isolation level can be set using, for example, Connection.setTransactionIsolation(). Database servers may not support all of these isolation levels. Oracle server supports only two isolation levels, TRANSACTION_READ_COMMITED and TRANSACTION_SERIALIZABLE isolation level, default isolation level is TRANSACTION_READ_COMMITED.