Wednesday, April 27, 2016

Spring Transaction Isolation Level

Spring Transaction Isolation Level

The standard levels are 2,3,4,5, the higher level, the poorer concurrency/effi
  1. ISOLATION_DEFAULT (Spring)
    This is a PlatformTransactionManager Default isolation level, using Default Database transaction level. The other 4 are correspond to JDBC isolation level
  2. ISOLATION_READ_UNCOMMITTED
    Lowest isolation level. Allow other transaction to see the data from this transaction. This level can cause dirty read, non-repeatable read, and illusion read
  3. ISOLATION_READ_COMMITTED (normally used)
    Promise other transaction can read data until this transaction committed.
  4. ISOLATION_REPEATABLE_READ
    Prevent dirty read, non-repeatable read. But can illusion read.
  5. ISOLATION_SERIALIZABLE
    This is most expensive level, but most reliable. It promise Sequence. Prevent dirty read, non-repeatable read, and illusion read

No comments:

Post a Comment