Sobes.tech
Middle+

Does Postgres support the READ UNCOMMITTED isolation level? What happens if it is specified in @Transactional?

sobes.tech AI

Answer from AI

PostgreSQL does not support the READ UNCOMMITTED isolation level. In PostgreSQL, the minimum isolation level is READ COMMITTED.

If you specify isolation = Isolation.READ_UNCOMMITTED in the @Transactional annotation, then:

  • Spring will attempt to set this isolation level for the transaction.
  • However, PostgreSQL will ignore this level and will use READ COMMITTED.

Thus, the transaction will effectively operate at the READ COMMITTED level, not READ UNCOMMITTED.

This is due to PostgreSQL's MVCC architecture, which does not allow reading uncommitted data (dirty reads).