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)
请升级至1.5.x就可以了
回复 @tony.chen:因为信息比较少,比如没有看到代码是怎么写的,数据库表结构是什么,具体的分片策略又是怎么配的。因此很难断定。不过新版本就是为了修复旧版本的bug,因此由于精力有限,我们也不会再关注1.4.x了。感谢亮哥回答、请问这是1.4的bug吗版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。