JDBC Phantom Read - What is phantom read?

          

Interview questions

JDBC Phantom Read

NEXT>>
Phantom read in JDBC - posted by Amit Satpute

What is phantom read?

Answer
If you execute a query at time T1 and re-execute it at time T2, additional rows may have been added to the database, which may affect your results.  

This differs from a nonrepeatable read in which data already read hasn't been changed but more data satisfies your query criteria than before.This problem can be solved by setting the transaction isolation level to TRANSACTION_SERIALIZABLE  


Phantom read in JDBC - posted by Vidya Sagar

What is a non-repeatable read? What is phantom read?

Non-repeatable read:

While performing select statement, non-repeatable reads my occur when read locks are not acquired. Non-repeatable reads may occur at the need of effected transaction by a commit conflict, must roll back is relaxed.

Phantom read:

At the time of execution of a transaction, if two queries that are identical are executed, and the rows returned are different from one another, it is stated that a phantom read occurred. The possibility of occurring phantom reads is when the range locks are not acquired by the execution of SELECT.

 

NEXT>>


Write your comment - Share Knowledge and Experience

Discussion Board
feedback

Hi The explanation is not not clear it is rather confusing the reader. It would be good if you give more elaborated content.

Munuswamy 07-20-2015 07:46 AM

 

More JDBC Links

What are different types of resultset in JDBC?

Answer - Resultset contains results of the SQL query.....

What are different transaction levels in JDBC?

Answer - Transaction Isolation levels is used to implement locking.....

Explain optimistic and pessimistic locking in JDBC.

Answer - There are two kinds of locking available in JDBC.....

What causes the "No suitable driver" error?

Answer - Failure to load the appropriate JDBC driver before giving a call to .....

 
Latest placement tests
Latest links
 
Latest MCQs
» General awareness - Banking » ASP.NET » PL/SQL » Mechanical Engineering
» IAS Prelims GS » Java » Programming Language » Electrical Engineering
» English » C++ » Software Engineering » Electronic Engineering
» Quantitative Aptitude » Oracle » English » Finance
Home | About us | Sitemap | Contact us | We are hiring