为了账号安全,请及时绑定邮箱和手机立即绑定

Mysql不支持JDBC的autoCommit事务操作吗?

Mysql不支持JDBC的autoCommit事务操作吗?

喵喔喔 2019-02-24 22:16:20
下面是com.mysql.jdbc.ConnectionImpl类的setAutoCommit(boolean flag)方法的注释 最后一句,Note: MySQL does not support transactions, so this method is ano-op. /** * If a connection is in auto-commit mode, than all its SQL statements will * be executed and committed as individual transactions. Otherwise, its SQL * statements are grouped into transactions that are terminated by either * commit() or rollback(). By default, new connections are in auto- commit * mode. The commit occurs when the statement completes or the next execute * occurs, whichever comes first. In the case of statements returning a * ResultSet, the statement completes when the last row of the ResultSet has * been retrieved or the ResultSet has been closed. In advanced cases, a * single statement may return multiple results as well as output parameter * values. Here the commit occurs when all results and output param values * have been retrieved. * <p> * <b>Note:</b> MySQL does not support transactions, so this method is a * no-op. * </p> * * @param autoCommitFlag - * true enables auto-commit; false disables it * @exception SQLException * if a database access error occurs */
查看完整描述

1 回答

?
肥皂起泡泡

TA贡献1829条经验 获得超6个赞

你的Mysql表类型是 innodb 还时 myisam 后者是不支持事务的

查看完整回答
反对 回复 2019-03-01
  • 1 回答
  • 0 关注
  • 602 浏览

添加回答

举报

0/150
提交
取消
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号