Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Operation not allowed after ResultSet closed #9883

Closed
BruceZhangXL opened this issue Mar 30, 2021 · 2 comments
Closed

Operation not allowed after ResultSet closed #9883

BruceZhangXL opened this issue Mar 30, 2021 · 2 comments

Comments

@BruceZhangXL
Copy link

Which version of ShardingSphere did you use?

version of ShardingSphere 4.1.1
version of druid 1.1.22
version of mysql-connector-java 8.0.17

Which project did you use?

ShardingSphere-JDBC

Actual behavior

Caused by: java.sql.SQLException: Operation not allowed after ResultSet closed at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129) at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97) at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:89) at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:63) at com.mysql.cj.jdbc.result.ResultSetImpl.checkClosed(ResultSetImpl.java:437) at com.mysql.cj.jdbc.result.ResultSetImpl.checkRowPos(ResultSetImpl.java:481) at com.mysql.cj.jdbc.result.ResultSetImpl.getString(ResultSetImpl.java:834) at com.alibaba.druid.filter.FilterChainImpl.resultSet_getString(FilterChainImpl.java:951) at com.alibaba.druid.filter.stat.StatFilter.resultSet_getString(StatFilter.java:968) at com.alibaba.druid.filter.FilterChainImpl.resultSet_getString(FilterChainImpl.java:947) at com.alibaba.druid.proxy.jdbc.ResultSetProxyImpl.getString(ResultSetProxyImpl.java:684) at com.alibaba.druid.pool.DruidPooledResultSet.getString(DruidPooledResultSet.java:110) at org.apache.shardingsphere.core.execute.sql.execute.result.StreamQueryResult.getValue(StreamQueryResult.java:74) at org.apache.shardingsphere.underlying.merge.impl.StreamMergedResult.getValue(StreamMergedResult.java:49) at org.apache.shardingsphere.encrypt.merge.dql.EncryptMergedResult.getValue(EncryptMergedResult.java:50) at org.apache.shardingsphere.shardingjdbc.jdbc.core.resultset.ShardingResultSet.getString(ShardingResultSet.java:164) at org.apache.ibatis.type.StringTypeHandler.getNullableResult(StringTypeHandler.java:37) at org.apache.ibatis.type.StringTypeHandler.getNullableResult(StringTypeHandler.java:26) at org.apache.ibatis.type.BaseTypeHandler.getResult(BaseTypeHandler.java:81) at org.apache.ibatis.executor.resultset.DefaultResultSetHandler.getPropertyMappingValue(DefaultResultSetHandler.java:472) at org.apache.ibatis.executor.resultset.DefaultResultSetHandler.applyPropertyMappings(DefaultResultSetHandler.java:441) at org.apache.ibatis.executor.resultset.DefaultResultSetHandler.getRowValue(DefaultResultSetHandler.java:404) at org.apache.ibatis.executor.resultset.DefaultResultSetHandler.handleRowValuesForSimpleResultMap(DefaultResultSetHandler.java:354) at org.apache.ibatis.executor.resultset.DefaultResultSetHandler.handleRowValues(DefaultResultSetHandler.java:328) at org.apache.ibatis.executor.resultset.DefaultResultSetHandler.handleResultSet(DefaultResultSetHandler.java:301) at org.apache.ibatis.executor.resultset.DefaultResultSetHandler.handleResultSets(DefaultResultSetHandler.java:194) at org.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHandler.java:65) at org.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:79) 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 org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:83) at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:147) at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:140) at sun.reflect.GeneratedMethodAccessor291.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:426) ... 99 common frames omitted

Reason analyze

First, whether the change code of #166 issure is miss.

I compared the changed code of this issure to the version of 4.1.1 in StatementExecutor.java, I can not find the synchronized code what try to solve the proplem of #166 .

code of fixed #166

image

code of 4.1.1

image

Sencod, if someone refator the code ,maybe the proplem still exists.

@dongzl
Copy link
Contributor

dongzl commented Apr 1, 2021

Hi @BruceZhangXL , can you test the problem with the newest version, the master branch code?

@terrymanu
Copy link
Member

No response anymore, I just close the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants