What is phantom read and which isolation level prevents it?



What is phantom read and which isolation level prevents it?..

Answer / Pradip Kumar Dubey

"Phantom Read" occurs in database transactions when a transaction re-reads data that was inserted or deleted by another concurrent transaction. This leads to inconsistent results as the data has changed between the initial read and the final commit. The isolation level that prevents Phantom Read is "REPEATABLE_READ". In JDBC, this can be set using the Connection object's setTransactionIsolation method.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More JDBC Interview Questions

What is odbc jdbc?

1 Answers  


dear friends I have made connection with SQLSERVER where the following code is compiling properly but giving error at the runtime . I think error in this line where i am sending the value through string Connection connection = DriverManager.getConnection ( "jdbc:microsoft:sqlserver://localhost:1433","sa",""); import java.sql.*; //import mssqlserver.*; public class TestSQLCON { public TestSQLCON() throws Exception { // Get connection DriverManager.registerDriver(new com.microsoft.jdbc.sqlserver.SQLServerDriver()); System.out.println(); System.out.println("Successfully connected one"); System.out.println(); Connection connection = DriverManager.getConnection ( "jdbc:microsoft:sqlserver://localhost:1433","sa",""); if (connection != null) { System.out.println(); System.out.println("Successfully connected"); System.out.println(); // Meta data DatabaseMetaData meta = connection.getMetaData(); System.out.println("\nDriver Information"); System.out.println("Driver Name: " + meta.getDriverName()); System.out.println("Driver Version: " + meta.getDriverVersion()); System.out.println("\nDatabase Information "); System.out.println("Database Name: " + meta.getDatabaseProductName()); System.out.println("Database Version: "+ meta.getDatabaseProductVersion()); } } public static void main (String args[]) throws Exception { TestSQLCON test = new TestSQLCON(); } } so please help me

2 Answers  


What is a lock in jdbc?

1 Answers  


How to find number of records in result set?

2 Answers  


How do I insert an image file (or other raw data) into a database?

1 Answers  


Is the JDBC-ODBC Bridge multi-threaded?

2 Answers   Wipro,


Are all the required JDBC drivers to establish connectivity to my database part of the JDK?

1 Answers  


preparedstatement p= new preparedstatement is it possible ?

10 Answers   Fidelity, IBM, Infrasys,


Why is jdbc used?

1 Answers  


What is sqlwarning and discuss the procedure of retrieving warnings?

1 Answers  


Write an sql to find all records having all upper case alphanumeric characters in a field ?

1 Answers  


Once I have the Java 2 SDK, Standard Edition, from Sun, what else do I need to connect to a database?

1 Answers  


Categories