GBase 8s
适配迁移
问答

在修改表的某条数据时,查询表数据报错 “记录已锁定,不能以物理排行顺序读下一行”

发表于2023-12-21 17:14:06635次浏览3个评论

为提高效率,提问时请提供以下信息,问题描述清晰可优先响应。

【GBase版本】:  GBase 8s

【操作系统】:  麒麟

【CPU】:

【问题描述】*:
Caused by: java.sql.SQLException: 不能以物理排行顺序读下一行。
    at com.gbasedbt.jdbc.IfxSqli.a(IfxSqli.java:3574)
    at com.gbasedbt.jdbc.IfxSqli.D(IfxSqli.java:3856)
    at com.gbasedbt.jdbc.IfxSqli.dispatchMsg(IfxSqli.java:2746)
    at com.gbasedbt.jdbc.IfxSqli.receiveMessage(IfxSqli.java:2671)
    at com.gbasedbt.jdbc.IfxSqli.a(IfxSqli.java:1898)
    at com.gbasedbt.jdbc.IfxSqli.executeExecute(IfxSqli.java:2599)
    at com.gbasedbt.jdbc.IfxSqli.executeExecute(IfxSqli.java:2554)
    at com.gbasedbt.jdbc.IfxResultSet.b(IfxResultSet.java:372)
    at com.gbasedbt.jdbc.IfxStatement.a(IfxStatement.java:1412)
    at com.gbasedbt.jdbc.IfxPreparedStatement.d(IfxPreparedStatement.java:623)
    at com.gbasedbt.jdbc.IfxPreparedStatement.execute(IfxPreparedStatement.java:605)
    at com.alibaba.druid.filter.FilterChainImpl.preparedStatement_execute(FilterChainImpl.java:3461)
    at com.alibaba.druid.filter.FilterEventAdapter.preparedStatement_execute(FilterEventAdapter.java:440)
    at com.alibaba.druid.filter.FilterChainImpl.preparedStatement_execute(FilterChainImpl.java:3459)
    at com.alibaba.druid.proxy.jdbc.PreparedStatementProxyImpl.execute(PreparedStatementProxyImpl.java:167)
    at com.alibaba.druid.pool.DruidPooledPreparedStatement.execute(DruidPooledPreparedStatement.java:497)
    at sun.reflect.GeneratedMethodAccessor142.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.apache.ibatis.logging.jdbc.PreparedStatementLogger.invoke(PreparedStatementLogger.java:59)
    at com.sun.proxy.$Proxy175.execute(Unknown Source)
    at org.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHandler.java:63)
    at org.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:79)
    at sun.reflect.GeneratedMethodAccessor141.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:63)
    at com.sun.proxy.$Proxy144.query(Unknown Source)
    at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:63)
    at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:324)
    at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:156)
    at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:109)
    at com.github.pagehelper.PageInterceptor.intercept(PageInterceptor.java:108)
    at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:61)
    at com.sun.proxy.$Proxy210.query(Unknown Source)
    at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:148)
    at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:141)
    at org.apache.ibatis.session.defaults.DefaultSqlSession.selectOne(DefaultSqlSession.java:77)
    at sun.reflect.GeneratedMethodAccessor156.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:433)
    ... 21 common frames omitted
Caused by: java.sql.SQLException: ISAM 错误:记录已锁定。
    at com.gbasedbt.util.IfxErrMsg.getSQLException(IfxErrMsg.java:409)
    at com.gbasedbt.jdbc.IfxSqli.D(IfxSqli.java:3861)
    ... 61 common frames omitted

评论

登录后才可以发表评论
用户头像
wty发表于 2年前
java.sql.SQLException: 不能以物理排行顺序读下一行。
这个是在表里读数据遇到错误
java.sql.SQLException: ISAM 错误:记录已锁定。
这个是错误原因,有锁

在jdbc连接串上加上锁等待参数 IFX_LOCK_MODE_WAIT=10 单位是秒
最佳回答
用户头像
liaosnet发表于 2年前
你这大概率是顺序扫描了,更新的条件没有索引。。
用户头像
GBase用户28017发表于 4个月前
3