- Win10
- IntelliJ IDEA 2020.3 (Ultimate Edition)
- Gradle 6.8.3
- Java 8
- Spring Boot 2.3.10.RELEASE
Go to here to change your testing database type and you can custom your database ip or port.
# Database Type(h2 mysql postgresql sqlite sqlserver)
database-type=h2
# Change to your custom mysql ip or port
mysql-ip=localhost
mysql-port=3306
# Change to your custom postgresql ip or port
postgresql-ip=localhost
postgresql-port=5432
# Change to your custom sqlserver ip or port
sqlserver-ip=localhost
sqlserver-port=4033
Isolation Level | Dirty Read | Unrepeatable Read | Phantom Read | Lost Update |
---|---|---|---|---|
DEFAULT | not occur | may occur | may occur | may occur |
READ_UNCOMMITTED | may occur | may occur | may occur | may occur |
READ_COMMITTED | not occur | may occur | may occur | may occur |
REPEATABLE_READ | not occur | not occur | not occur | may occur |
SERIALIZABLE | not occur | not occur | not occur | may occur |
- Isolation Level
DEFAULT
seems to be equal toREAD_COMMITTED
.
Version: MySQL 5.7 InnoDB
Isolation Level | Dirty Read | Unrepeatable Read | Phantom Read | Lost Update |
---|---|---|---|---|
DEFAULT | not occur | not occur | may occur | may occur |
READ_UNCOMMITTED | may occur | may occur | may occur | may occur |
READ_COMMITTED | not occur | may occur | may occur | may occur |
REPEATABLE_READ | not occur | not occur | may occur | may occur |
SERIALIZABLE | not occur | not occur | not occur | not occur |
- Isolation Level
DEFAULT
seems to be equal toREPEATABLE_READ
.- In the
Lost Update
problem, theSERIALIZABLE
in Isolation Level must be retried with@Retryable
; otherwise, it will throwLockAcquisitionException
.
Version: PostgreSQL 13.2
Isolation Level | Dirty Read | Unrepeatable Read | Phantom Read | Lost Update |
---|---|---|---|---|
DEFAULT | not occur | may occur | may occur | may occur |
READ_UNCOMMITTED | not occur | may occur | may occur | may occur |
READ_COMMITTED | not occur | may occur | may occur | may occur |
REPEATABLE_READ | not occur | not occur | not occur | not occur |
SERIALIZABLE | not occur | not occur | not occur | not occur |
- Isolation Level
DEFAULT
seems to be equal toREAD_COMMITTED
.- In the
Lost Update
problem, theREPEATABLE_READ
、SERIALIZABLE
in Isolation Level must be retried with@Retryable
; otherwise, it will throwLockAcquisitionException
Isolation Level | Dirty Read | Unrepeatable Read | Phantom Read | Lost Update |
---|---|---|---|---|
DEFAULT | not occur | not occur | not occur | not occur |
READ_UNCOMMITTED | not occur | not occur | not occur | not occur |
SERIALIZABLE | not occur | not occur | not occur | not occur |
- SQLite supports only
TRANSACTION_SERIALIZABLE
andTRANSACTION_READ_UNCOMMITTED
.- SQLite does not support concurrent writing, so you need to perform lock contention or retry writing.
Version: Microsoft SQL Server 2019 (RTM-CU10) (KB5001090) - 15.0.4123.1 (X64)
Isolation Level | Dirty Read | Unrepeatable Read | Phantom Read | Lost Update |
---|---|---|---|---|
DEFAULT | not occur | may occur | may occur | may occur |
READ_UNCOMMITTED | may occur | may occur | may occur | may occur |
READ_COMMITTED | not occur | may occur | may occur | may occur |
REPEATABLE_READ | not occur | not occur | may occur | not occur |
SERIALIZABLE | not occur | not occur | not occur | not occur |
- Isolation Level
DEFAULT
seems to be equal toREAD_COMMITTED
.- In the
Lost Update
problem, theREPEATABLE_READ
、SERIALIZABLE
in Isolation Level must be retried with@Retryable
; otherwise, it will throwLockAcquisitionException
.