写点什么

【YashanDB 知识库】YashanDB JDBC 查询时抛出 YAS-02094 current session has been killed or canceled 异常

作者:YashanDB
  • 2025-01-07
    广东
  • 本文字数:819 字

    阅读完需:约 3 分钟

YashanDB JDBC 查询时抛出 YAS-02094 current session has been killed or canceled 异常首页 ꁇ YashanDB JDBC 查询时抛出 YAS-02094 current session has been killed or canceled 异常业务在执行 SQL 语句时抛出了 YAS-02094 current session has been killed or canceled 异常,堆栈如下:


Caused by: java.sql.SQLTimeoutException: [line: 0 column: 0] YAS-02094 current session has been killed or canceled


    at com.yashandb.jdbc.exception.SQLExceptionType$9.a(Unknown Source)
at com.yashandb.jdbc.exception.SQLExceptionType.newSQLException(Unknown Source)
at com.yashandb.jdbc.exception.SQLError.createSQLException(Unknown Source)
at com.yashandb.jdbc.exception.SQLError.createSQLException(Unknown Source)
at com.yashandb.protocol.NativeProtocol.checkServerError(Unknown Source)
at com.yashandb.protocol.NativeProtocol.receivePacket(Unknown Source)
at com.yashandb.protocol.NativeProtocol.sendCommand(Unknown Source)
at com.yashandb.SessionImpl.a(Unknown Source)
at com.yashandb.SessionImpl.a(Unknown Source)
at com.yashandb.SessionImpl.a(Unknown Source)
at com.yashandb.SessionImpl.b(Unknown Source)
at com.yashandb.SessionImpl.a(Unknown Source)
at com.yashandb.SessionImpl.a(Unknown Source)
at com.yashandb.SessionImpl.execute(Unknown Source)
at com.yashandb.jdbc.PreparedStatementImpl.b(Unknown Source)
at com.yashandb.jdbc.PreparedStatementImpl.executeQuery(Unknown Source)
复制代码


问题原因:SQL 语句的执行时间超过了 PreparedStatement 对象 setQueryTimeout 指定的时间(单位:秒),或者中间件类似参数(例如 druid 的 query-timeout,单位:秒)指定的时间


解决办法:优化 SQL 语句减少执行时间或者调大对应的参数设置

发布于: 刚刚阅读数: 2
用户头像

YashanDB

关注

全自研国产新型大数据管理系统 2022-02-15 加入

还未添加个人简介

评论

发布
暂无评论
【YashanDB知识库】YashanDB JDBC查询时抛出YAS-02094 current session has been killed or canceled异常_数据库_YashanDB_InfoQ写作社区