降低mysql事务隔离级别
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了降低mysql事务隔离级别相关的知识,希望对你有一定的参考价值。
测试代码的时候实验了下降低事物隔离级别:
Connection conn = null; try { conn = DBUtils.getConnection(); conn.setAutoCommit(false); conn.setTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED);
............
然而,报错了
java.sql.SQLException: Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT and at least one table uses a storage engine
limited to row-based logging. InnoDB is limited to row-logging when transaction isolation level is READ COMMITTED or READ UNCOMMITTED.
于是看了下BINLOG_FORMAT :
于是:
这样就可以了,或者据说换MIXED模式也可以,不过没测试。
以上是关于降低mysql事务隔离级别的主要内容,如果未能解决你的问题,请参考以下文章