码迷,mamicode.com
首页 > 数据库 > 详细

降低mysql事务隔离级别

时间:2016-10-09 20:02:24      阅读:190      评论:0      收藏:0      [点我收藏+]

标签:

  测试代码的时候实验了下降低事物隔离级别:

            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事务隔离级别

标签:

原文地址:http://www.cnblogs.com/saaav/p/5943393.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!