What is a “dirty read”?

What is a "dirty read"?

- In typical database transactions, one transaction reads changes the value while the other reads the value before committing or rolling back by the first transaction. This reading process is called as 'dirty read'.

Because there is always a chance that the first transaction might rollback the change which causes the second transaction reads an invalid value.

- It takes no notice of any other lock taken by another process.

- It is a problem if the uncommitted transaction fails or is rolled back.

Example: suppose transaction 1 updates a row. Transaction 2 reads the updated row before transaction 1 commits the update. If transaction 1 rolls back the change, transaction 2 will have read data that is considered never to have existed.
Cold backup, hot backup, and warm backup recovery
JDBC - Cold backup, hot backup, and warm backup recovery - Cold backup is a recovery technique, in which the files must be backed up before the database is restarted at the same time...
What is 2 phase commit?
What is 2 phase commit? - Distributed transactions are performed by relational databases...
Different types of resultset in JDBC
JDBC Resultset Types - Resultset contains results of the SQL query. There are 3 basic types of resultset...
Post your comment
Discussion Board
dirty-read. in jdbc
when the data is not store in database it is on flash memory that data called dirty data and reading that data called dirty read this is isolation part of ACID property in Data base.
some Thread interview question check http://www.javaaster.com
Tarun 04-12-2013