2 hcrs2015 hcrs2015 于 2016.02.26 15:14 提问

Mysql做了主从配置之后,启动项目就出现异常了。提示Hibernate什么的,不知道这么回事

2016-02-25 13:38:51,353 [localhost-startStop-1] [test.ResourceBuilder] [INFO] - Hibernate operation: could not insert: [accessResources.BtnAndMenu]; uncategorized SQLException for SQL [insert into btn_and_menu (version, action, click, code, controller, icon, is_menu, label, link, parent_id, show_order, sys_type, title) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)]; SQL state [HY000]; error code [1665]; 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.; nested exception is 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.
2016-02-25 13:38:51,435 [localhost-startStop-1] [test.ResourceBuilder] [INFO] - [controller:orderSub, action:index, label:运营日志, dir:/images/icons/blueberry, img:logMgr.png, plugin:scaffolding]资源项初始化失败
2016-02-25 13:38:51,537 [localhost-startStop-1] [test.ResourceBuilder] [INFO] - [controller:orderSub, action:index, label:客户反馈, dir:/images/icons/blueberry, img:comment.png, plugin:scaffolding]资源项初始化失败
2016-02-25 13:38:51,636 [localhost-startStop-1] [test.ResourceBuilder] [INFO] - [controller:driverSignLog, action:index, label:车主签到, dir:/images/icons/blueberry, img:logMgr.png, plugin:scaffolding]资源项初始化失败
2016-02-25 13:38:51,707 [localhost-startStop-1] [org.hibernate.AssertionFailure] [ERROR] - an assertion failure occured (this may indicate a bug in Hibernate, but is more likely due to unsafe use of the session)
org.hibernate.AssertionFailure: null id in accessResources.BtnAndMenu entry (don't flush the Session after an exception occurs)
at org.grails.datastore.gorm.GormStaticApi$_methodMissing_closure2.doCall(GormStaticApi.groovy:101)
at test.ResourceBuilder$_btnConfigAnalyer_closure1.doCall(ResourceBuilder.groovy:21)
at test.ResourceBuilder.btnConfigAnalyer(ResourceBuilder.groovy:20)
at accessResources.BtnAndMenuService$_$tt__initFromController_closure5.doCall(BtnAndMenuService.groovy:87)
at accessResources.BtnAndMenuService.$tt__initFromController(BtnAndMenuService.groovy:83)
at RbacBootStrap$_closure1.doCall(RbacBootStrap.groovy:13)
at grails.util.Environment.evaluateEnvironmentSpecificBlock(Environment.java:308)
at grails.util.Environment.executeForEnvironment(Environment.java:301)
at grails.util.Environment.executeForCurrentEnvironment(Environment.java:277)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
2016-02-25 13:38:51,713 [localhost-startStop-1] [test.ResourceBuilder] [INFO] - null id in accessResources.BtnAndMenu entry (don't flush the Session after an exception occurs)
2016-02-25 13:38:51,717 [localhost-startStop-1] [org.hibernate.AssertionFailure] [ERROR] - an assertion failure occured (this may indicate a bug in Hibernate, but is more likely due to unsafe use of the session)
org.hibernate.AssertionFailure: null id in accessResources.BtnAndMenu entry (don't flush the Session after an exception occurs)
at org.grails.datastore.gorm.GormStaticApi$_methodMissing_closure2.doCall(GormStaticApi.groovy:101)
at test.ResourceBuilder$_btnConfigAnalyer_closure1.doCall(ResourceBuilder.groovy:21)
at test.ResourceBuilder.btnConfigAnalyer(ResourceBuilder.groovy:20)
at accessResources.BtnAndMenuService$_$tt__initFromController_closure5.doCall(BtnAndMenuService.groovy:87)
at accessResources.BtnAndMenuService.$tt__initFromController(BtnAndMenuService.groovy:83)
at RbacBootStrap$_closure1.doCall(RbacBootStrap.groovy:13)
at grails.util.Environment.evaluateEnvironmentSpecificBlock(Environment.java:308)
at grails.util.Environment.executeForEnvironment(Environment.java:301)
at grails.util.Environment.executeForCurrentEnvironment(Environment.java:277)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
2016-02-25 13:38:51,719 [localhost-startStop-1] [test.ResourceBuilder] [INFO] - null id in accessResources.BtnAndMenu entry (don't flush the Session after an exception occurs)
2016-02-25 13:38:51,722 [localhost-startStop-1] [org.hibernate.AssertionFailure] [ERROR] - an assertion failure occured (this may indicate a bug in Hibernate, but is more likely due to unsafe use of the session)
org.hibernate.AssertionFailure: null id in accessResources.BtnAndMenu entry (don't flush the Session after an exception occurs)
at org.grails.datastore.gorm.GormStaticApi$_methodMissing_closure2.doCall(GormStaticApi.groovy:101)
at test.ResourceBuilder$_btnConfigAnalyer_closure1.doCall(ResourceBuilder.groovy:21)
at test.ResourceBuilder.btnConfigAnalyer(ResourceBuilder.groovy:20)
at accessResources.BtnAndMenuService$_$tt__initFromController_closure5.doCall(BtnAndMenuService.groovy:87)
at accessResources.BtnAndMenuService.$tt__initFromController(BtnAndMenuService.groovy:83)
at RbacBootStrap$_closure1.doCall(RbacBootStrap.groovy:13)
at grails.util.Environment.evaluateEnvironmentSpecificBlock(Environment.java:308)
at grails.util.Environment.executeForEnvironment(Environment.java:301)
at grails.util.Environment.executeForCurrentEnvironment(Environment.java:277)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)


3个回答

qq423399099
qq423399099   Ds   Rxr 2016.02.26 15:29

貌似是statement模式不足以应付应用,换成mixed试试看吧:

mysql> STOP SLAVE;
Query OK, 0 rows affected (0.02 sec)

mysql> SET GLOBAL binlog_format=MIXED;
Query OK, 0 rows affected (0.00 sec)

mysql> START SLAVE;
Query OK, 0 rows affected (0.00 sec)

但是这样只会一次性

为了永久生效,需要修改my.ini

Remove leading

to turn on a very important data integrity option: logging

changes to the binary log between backups.

log_bin = E:/mysql56/log_bin/log_bin.log

#relay_log = E:/mysql56/log_bin/relay_log.log

#read_only = 1

binary logging format - mixed recommended

binlog_format=mixed

qq423399099
qq423399099 也可以改成ROW模式试试 http://www.linuxidc.com/Linux/2014-04/99743.htm
接近 2 年之前 回复
nohaoye
nohaoye   2016.02.26 19:46
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

不是写得很详细么


http://blog.itpub.net/26855487/viewspace-775827/

http://stackoverflow.com/questions/33142095/impossible-to-write-to-binary-log-since-binlog-format-statement-and-at-least-o

Royal_lr
Royal_lr   Ds   Rxr 2016.02.26 19:56

mysql 不能随便做更改的,,

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!