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 语句减少执行时间或者调大对应的参数设置
评论