开发者社区 问答 正文

Jfinal连接mysql,insert一条数据时候报错。?报错

 com.jfinal.plugin.activerecord.ActiveRecordException: 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. 

这是在google找到的一个解决http://stackoverflow.com/questions/18427743/can-not-execute-update-statement-at-toad-for-mysql-but-in-other-tools?answertab=active#tab-top

我修改DBKIT的源码,把transactionLevel设置为TRANSACTION_READ_UNCOMMITTED

但是还是不行。想问下有没人碰到过同样的问题。是什么原因引起的?怎么解决?问题是今天才发现。找了很久资料都没找到相关的。。mysql的论坛上只有提问没解决。。在线等待ING


展开
收起
爱吃鱼的程序员 2020-06-22 14:22:06 467 分享
分享
版权
举报
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB

    貌似不是用new一个model插入的,没看懂。。能再具体一点吗?用jfinal你还需要写insert?那你用jfinal干嘛。。大哥有看过我的问题描述吗?你的回答没看懂哎。。。你设置了事务隔离级别为<spanstyle="font-family:楷体,Verdana,sans-serif,宋体;font-size:14px;line-height:22px;background-color:#FFFFFF;">TRANSACTION_READ_UNCOMMITTED,需要把SESSION和binary-log设置为mixed或者row,具体<preclass="brush:sql;toolbar:true;auto-links:false;">mysql>SETSESSIONbinlog_format='ROW';mysql>SETGLOBALbinlog_format='ROW';<preclass="brush:sql;toolbar:true;auto-links:false;"><preclass="brush:sql;toolbar:true;auto-links:false;">补充:在<spanstyle="font-family:Arial;font-size:14px;line-height:26px;background-color:#FFFFFF;">READCOMMITTED或READUNCOMMITTED隔离级别下,binlog只能使用ROW模式。如果不设置默认为STATEMENT

    2020-06-22 14:22:24 举报
    赞同 评论

    评论

    全部评论 (0)

    登录后可评论
AI助理

你好,我是AI助理

可以解答问题、推荐解决方案等