The transaction tutorial explains in the section Using Transactions to Preserve Data Integrity :
The default transaction isolation level depends on your DBMS. For example, for Java DB, it is TRANSACTION_READ_COMMITTED.
For my Postgresql database it is the same. But this does not seem to be the best, because only TRANSACTION_SERIALIZABLE
prevents all inconsistencies:
Isolation Level │Transactions │Dirty Reads │Non-Repeatable Reads│Phantom Reads
=============================================================================================
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
Why is not the best option the default?
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.