zhang474089868 2016-05-17 09:12 采纳率: 50%
浏览 1695

myeclipse链接mysql数据库报错

Unknown system variable 'tx_read_only'
Could not retrieve transation read-only status server
--- The error occurred in sqlmaps/user/userSQL.xml. --- The error occurred while applying a parameter map. --- Check the user.login-InlineParameterMap. --- Check the statement (query failed). --- Cause: java.sql.SQLException: Could not retrieve transation read-only status server
SqlMapClient operation; uncategorized SQLException for SQL []; SQL state [S1000]; error code [0]; --- The error occurred in sqlmaps/user/userSQL.xml. --- The error occurred while applying a parameter map. --- Check the user.login-InlineParameterMap. --- Check the statement (query failed). --- Cause: java.sql.SQLException: Could not retrieve transation read-only status server; nested exception is com.ibatis.common.jdbc.exception.NestedSQLException: --- The error occurred in sqlmaps/user/userSQL.xml. --- The error occurred while applying a parameter map. --- Check the user.login-InlineParameterMap. --- Check the statement (query failed). --- Cause: java.sql.SQLException: Could not retrieve transation read-only status server

  • 写回答

2条回答

  • 拿云之志 2016-05-17 09:26
    关注

    当数据库隔离级别为REPEATABLE-READ时,发布一个select语句也算是事物的开始,而且在hibernate里会把以select语句开头的事务标记为只读事务,此时在这个事务里再执行insert、update、delete等DML语句就会报错;
    解决办法:修改事务类型;
    如果没有用框架,在数据库执行 SET GLOBAL tx_isolation='READ-COMMITTED';
    如果使用框架,如Hibernate,可是使用配置。

    评论

报告相同问题?

悬赏问题

  • ¥15 DIFY API Endpoint 问题。
  • ¥20 sub地址DHCP问题
  • ¥15 delta降尺度计算的一些细节,有偿
  • ¥15 Arduino红外遥控代码有问题
  • ¥15 数值计算离散正交多项式
  • ¥30 数值计算均差系数编程
  • ¥15 redis-full-check比较 两个集群的数据出错
  • ¥15 Matlab编程问题
  • ¥15 训练的多模态特征融合模型准确度很低怎么办
  • ¥15 kylin启动报错log4j类冲突