Cannot change transaction read-only property in the middle of a transaction

前端 未结 2 1499
难免孤独
难免孤独 2021-01-20 16:43

I am using BoneCP with Postgresql and Spring JdbcTemplate. When JdbcTemplate executes query and then tries to close the connection, it gets this exception:

相关标签:
2条回答
  • 2021-01-20 16:51

    I ran into the same issue and was able to solve it by doing these two steps:

    • setting the isolation level by adding these statement: config.setDefaultTransactionIsolation("READ UNCOMMITTED");

    • commit every transaction before closing.

    I am not sure which one solved the problem or if both are necessary.

    0 讨论(0)
  • 2021-01-20 17:10

    I ran into this issue today. You might be missing one of the required dependencies of boneCP.

    I was missing SLF4J library, and receiving the same message. Check whether you have the dependencies here: http://jolbox.com/index.html?page=http://jolbox.com/requirements.html

    0 讨论(0)
提交回复
热议问题