qq_20291805
key-h
2016-06-15 01:35
采纳率: 33.3%
浏览 15.5k
已采纳

跪求大神帮忙,正式环境偶尔才出现could not prepare statement

  • SQL Error: 17008, SQLState: 08003
  • Closed Connection
  • could not prepare statement org.hibernate.exception.JDBCConnectionException: could not prepare statement at org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:132) at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:49) at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:124) at org.hibernate.engine.jdbc.internal.StatementPreparerImpl$StatementPreparationTemplate.prepareStatement(StatementPreparerImpl.java:193) at org.hibernate.engine.jdbc.internal.StatementPreparerImpl.prepareQueryStatement(StatementPreparerImpl.java:157) at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1881) at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1858) at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1838) at org.hibernate.loader.Loader.doQuery(Loader.java:906) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:348) at org.hibernate.loader.Loader.doList(Loader.java:2550) at org.hibernate.loader.Loader.doList(Loader.java:2536) at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2366) at org.hibernate.loader.Loader.list(Loader.java:2361)
  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

3条回答 默认 最新

  • qq_32341135
    LRHuoLang19 2016-06-15 02:44
    已采纳

    你这个看起来应该是数据库连接异常“JDBCConnectionException”,是不是跟数据库连接断开了?

    点赞 评论
  • zy_281870667
    Bug开发攻城狮 2016-06-15 02:05

    很可能 表名是关键字,查看是否有 user 类似的表名

    点赞 评论
  • w172087242
    little_how 2016-06-15 03:12

    这个可能是懒加载造成的,就是某些时候在连接关闭后,还试图获取hibernate配置的关联的lazy=true的表数据

    点赞 评论

相关推荐