top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

What is JDBC Connection isolation levels?

0 votes
365 views
What is JDBC Connection isolation levels?
posted Aug 22, 2017 by anonymous

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

When we use JDBC Transactions for data integrity, DBMS uses locks to block access by others to the data being accessed by the transaction. DBMS uses locks to prevent Dirty Read, Non-Repeatable Reads and Phantom-Read issue.

JDBC transaction isolation level is used by DBMS to use the locking mechanism, we can get the isolation level information through Connection getTransactionIsolation() method and set it with setTransactionIsolation() method.

 ISOLATION LEVEL                TRANSACTION    DIRTY READ      NON-REPEATABLE READ     PHANTOM READ
TRANSACTION_NONE                Not Supported  Not Applicable  Not Applicable          Not Applicable
TRANSACTION_READ_COMMITTED      Supported      Prevented       Allowed                 Allowed
TRANSACTION_READ_UNCOMMITTED    Supported      Allowed         Allowed                 Allowed
TRANSACTION_REPEATABLE_READ     Supported      Prevented       Prevented               Allowed
TRANSACTION_SERIALIZABLE        Supported      Prevented       Prevented               Prevented
answer Aug 23, 2017 by Riya Kumari
...