Skip to content

Cannot change transaction isolation level in the middle of a transaction #97

@whiskeysierra

Description

@whiskeysierra

Steps to reproduce

  • default-auto-commit: false
  • default-transaction-isolation: 2
  • @Transactional(isolation = SERIALIZABLE)

Observed behaviour

PSQLException: Cannot change transaction isolation level in the middle of a transaction.
  at org.postgresql.jdbc.PgConnection.setTransactionIsolation(PgConnection.java:880)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

Most tests fail, though some of them actually work, even with writes.

Expected behaviour

  • all steps to reproduce work without exception

Investigation

According to most docs/issues it looks like the problem usually occurs when connection validation is enabled and the test query is executed inside a transaction but without commit or rollback. But tests are disabled in our case (test-on-borrow: false) and it still fails.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions