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

Exception in thread "main" org.hibernate.exception.GenericJDBCException: could not execute statement

Exception in thread "main" org.hibernate.exception.GenericJDBCException: could not execute statement

at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:54)

at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:126)

at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:112)

at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:190)

at org.hibernate.engine.jdbc.batch.internal.NonBatchingBatch.addToBatch(NonBatchingBatch.java:62)

at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:3124)

at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:3587)

at org.hibernate.action.internal.EntityInsertAction.execute(EntityInsertAction.java:103)

at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:453)

at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:345)

at org.hibernate.event.internal.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:350)

at org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:56)

at org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1218)

at org.hibernate.internal.SessionImpl.managedFlush(SessionImpl.java:421)

at org.hibernate.engine.transaction.internal.jdbc.JdbcTransaction.beforeTransactionCommit(JdbcTransaction.java:101)

at org.hibernate.engine.transaction.spi.AbstractTransactionImpl.commit(AbstractTransactionImpl.java:177)

at com.imooc.entity.Test.add(Test.java:30)

at com.imooc.entity.Test.main(Test.java:11)

Caused by: java.sql.SQLException: Could not retrieve transation read-only status server

at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1078)

at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:989)

at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:975)

at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:920)

at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:951)

at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:941)

at com.mysql.jdbc.ConnectionImpl.isReadOnly(ConnectionImpl.java:3936)

at com.mysql.jdbc.ConnectionImpl.isReadOnly(ConnectionImpl.java:3907)

at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2408)

at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2375)

at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2359)

at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:187)

... 14 more

Caused by: java.sql.SQLException: Unknown system variable 'tx_read_only'

at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1078)

at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4120)

at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4052)

at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2503)

at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2664)

at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2809)

at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2758)

at com.mysql.jdbc.StatementImpl.executeQuery(StatementImpl.java:1612)

at com.mysql.jdbc.ConnectionImpl.isReadOnly(ConnectionImpl.java:3930)

... 19 more


正在回答

举报

0/150
提交
取消
Hibernate初探之一对多映射
  • 参与学习       42171    人
  • 解答问题       295    个

Hibernate中一对多关联映射配置,以及cascade和inverse属性作用

进入课程

Exception in thread "main" org.hibernate.exception.GenericJDBCException: could not execute statement

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信