(sharding-jdbc.1.4.2)根据分片键查询报错
SQL:
select * from td_user where user_id=#{userId}
td_user__00-09
分片策略根据userId取模
查询报Caused by: java.sql.SQLException: Operation not allowed after ResultSet closed
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.ResultSetImpl.checkClosed(ResultSetImpl.java:804)
at com.mysql.jdbc.ResultSetImpl.getMetaData(ResultSetImpl.java:3107)
at com.alibaba.druid.wall.WallFilter.preprocessResultSet(WallFilter.java:1381)
at com.alibaba.druid.wall.WallFilter.statement_getResultSet(WallFilter.java:636)
at com.alibaba.druid.filter.FilterChainImpl.statement_getResultSet(FilterChainImpl.java:2495)
at com.alibaba.druid.filter.FilterAdapter.statement_getResultSet(FilterAdapter.java:2560)
at com.alibaba.druid.filter.FilterEventAdapter.statement_getResultSet(FilterEventAdapter.java:426)
at com.alibaba.druid.filter.FilterChainImpl.statement_getResultSet(FilterChainImpl.java:2495)
at com.alibaba.druid.filter.FilterAdapter.statement_getResultSet(FilterAdapter.java:2560)
at com.alibaba.druid.filter.FilterEventAdapter.statement_getResultSet(FilterEventAdapter.java:426)
at com.alibaba.druid.filter.FilterChainImpl.statement_getResultSet(FilterChainImpl.java:2495)
at com.alibaba.druid.proxy.jdbc.StatementProxyImpl.getResultSet(StatementProxyImpl.java:349)
at com.alibaba.druid.pool.DruidPooledStatement.getResultSet(DruidPooledStatement.java:432)
at com.dangdang.ddframe.rdb.sharding.jdbc.ShardingStatement.getResultSet(ShardingStatement.java:326)
at org.apache.ibatis.executor.resultset.DefaultResultSetHandler.getFirstResultSet(DefaultResultSetHandler.java:175)
at org.apache.ibatis.executor.resultset.DefaultResultSetHandler.handleResultSets(DefaultResultSetHandler.java:143)
at org.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHandler.java:60)
at org.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:73)
at sun.reflect.GeneratedMethodAccessor182.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
感谢亮哥回答、请问这是1.4的bug吗
回复
因为信息比较少,比如没有看到代码是怎么写的,数据库表结构是什么,具体的分片策略又是怎么配的。因此很难断定。不过新版本就是为了修复旧版本的bug,因此由于精力有限,我们也不会再关注1.4.x了。
请升级至1.5.x就可以了